Skip to main content

DPS 909 - Release 0.2 - Hacktoberfest Week 3

I'll admit it right off: this week, I did not have a lot of time to spare for Hacktoberfest, so I was unable to tackle a new goal (out of the ones I set for myself at the start of the month). Nevertheless, I did not want to jank up the weekly momentum I had by missing a contribution, so I simply opted for a simple one instead. I found a nice project, by GitHub user vichitr, that focused on encouraging amateur contributors during Hacktoberfest, not unlike the last repo I contributed to. Instead of focusing on design patterns, vichitr's project contains a variety of issues that programmers are invited to tackle.

I decided to contribute to issue #6 on the repo, which is to implement a data structure in the language of your choice. Since I was short on time for the week, I decided to contribute a threaded tree by overhauling a previous project I did as a school assignment. A threaded tree is a binary search tree that supports easy, in-order traversal of its values. Normally, a node in a binary search tree will have a null reference if it does not contain any children (either to its left, right, or both). A threaded tree converts these null references to point to the next, in-order successor.

Visual example of a threaded binary search tree (image from Wikipedia)

I decided to make this augmentation to my original, much simpler binary tree class, as well as implement an iterator that would help traverse and find specific values. However, this decision turned out to be a bit more work than I anticipated. First of all, the binary search tree from my old assignment was severely outdated (and admittedly, rather poorly written!), and I had improved in my programming skills since I'd written the original code. I had to take the time to carefully analyze the code, correct bugs, memory leaks, and make additional comments in order to bring it up to my own current standards, as well as the standards of a public contribution. It isn't easy getting into one's own headspace from years ago! After I'd spent almost too long fixing my own, old code, I affected the changes necessary to augment the BST to a threaded tree.

All of the work made me wonder if it would have been more efficient if I simply wrote the entire implementation from scratch, rather than trying to build off of my old code.

In the end, I was able to submit a pull request to the project as a contribution to their collection of C++ data structures. Hopefully I will have a lot more time next week to make a far more meaningful contribution!

Comments

Popular posts from this blog

DPS909 - Lab 1 - Github Trending Research: WebGL Fluid Simulator

The WebGL Fluid Simulator is a small application that allows the user to play with simulated fluids right in their browser, and works on both PCs and mobile devices. The visual effects follow proper fluid dynamics, and can be manipulated in real time by pointing and click, as well as several available options such as quality, density, and velocity.  The app is written in JavaScript, and as the name suggests, visually renders its effects using WebGL. It was created by Github user PavelDoGreat based off another Github project:  Fluids-2D , and is distributed under the MIT license. As of September 8th, 2019, WebGL Fluid Simulator is trending with 2,307 stars during the month, and 6,070 stars in total. Main interface of WebGL Fluid Simulator by Github user PavelDoGreat I was interested in investigating this project as it demonstrates the breadth of open source resources on Github. Users can find projects that range from complex systems and APIs, to small plug-ins and simpl...

DPS 909 - Lab 3 - Hacktoberfest, and the Very Scary Repository

It's that time of year; the mornings are getting chilly, the leaves are turning, the pumpkin spice is flowing, and open source developers are getting all worked up over something called Hacktoberfest . Not to be confused with the other , similar-sounding (though arguably no less beer-filled) celebration, Hacktoberfest is a chance for open source enthusiast to truly flex their projects and contributions. Hosted by DigitalOcean , Hacktoberfest 2019 is an event running throughout the month of October that encourages activity in the open source community. It is completely free to sign up, and participants can even link their Github accounts to use as their Hacktoberfest profiles. As you may have already guessed, I will be participating in this event as my next major milestone on my journey into the world of open source. Through the miracle of APIs, even my profile picture was imported! While the prospect of diving headfirst into such a large, open source event as a beginner may s...

DPS 909 - Release 0.2 - Hacktoberfest Week 4

It's the home stretch for Hacktober fest! For my final contribution, I decided to tackle my last goal , which was simply to do something fun and interesting. Once again, thanks to GitHub user vichitr and his brilliant project , I was able to quickly find something to contribute. I've always thought that programming algorithms was a good challenge and invited great learning experiences, so for my final PR, I decided to program an example of the sliding window technique in Python. The sliding window technique is a very useful algorithm that is used across many disciplines of software design. It allows users to compare subsets of data (i.e. windows) within a larger collection, in order to find significant items. Personally, I have encountered the sliding window technique during some applied research projects that I have tackled in the past. In a particular machine learning project, I used the sliding window technique to construct subsets of data that were then fed into a separa...