Posts

Showing posts from 2018

Helping Mozilla firefox with enabling ESLint

Image
It was an amazing experience contributing to Mozilla Firefox. The bug that I worked on: here . For new developers to help with enabling ESLint with FireFox here are the steps that I took ( Window user ) assuming you already have a bug assigned to you: Follow Mozilla Build to download and get the "Required tools" and stop at "Getting the source" Download Mercurial . Continue with Getting the Source and stop at "Build FireFox!" it's not really needed when fixing ESLint bugs and saves some time. Remove your <directory path> from `.eslintignore`. Run `./mach eslint --fix <directory path>` this will run ESLint only for the specific directory you are fixing. Note: I was told to commit 2 versions: An automatic change version and a manual change version.      6.  So at this point I did `hg commit -m "Enable ESLint for <directory path> (automatic changes)"` Since I was told I needed 2 commits I wanted to push my

Testing out Travis CI for the first time

Travis CI is a continuous integration service that helps compile, build, test and deploy code for GitHub projects. Just to test it out I decided to add it to a repository that I was working on (Currently has no Continuous Integration bots) SenecaBlackBoardExtension . Now I have to give the bot something to do. Since SenecaBlackboardExtension is mostly JavaScript code I decided that the best starting point is to run ESLint with Travis CI. Travis CI can only be connected to a GitHub account that you own. I don't own that repository so to work around it I forked the repo so I have my version of it. With the help of David Humphrey , who was familiar with ESLint, and the ESLint and Travis user guides I was able to run ESLint with Travis in my forked repository of SenecaBlackBoardExtension. Once it worked on my forked version, in theory it should work in the main repo with little tweaks (Eg: The owner to connect his GitHub). So I made a pull request to add in the files that are n

Contributing to 2048 Repo cont'd

GitHub Repo: 2048 Previously, when I was working on this repository it turns out my code format was not consistent with what they had. I've noticed that they have a .clang-format file which means there should be a way for me to run it and auto format my code. After searching, I have found a couple of online formatters. When I used the online formatters it either spits back the same code format or it loads until timeout, either way I don't get what I am trying to do. I went back to searching for clang-formats and I came across a Visual Studio Code extension that allows me to use the .clang-format file. After running the clang-format on the source files, compiling errors start to arise from the .clang-format file which I have posted an issue on. After trying to fix a few of the errors the owner of the repo believes the error could be related to the VSCode extension. Apparently, they were using npm to run the clang-format file. Maybe I should have asked how they did the forma

DPS909 Release 0.3 PR3

For my third pull request in release 0.3 I had a tough time searching for an issue for an external project that I wanted to work on. After days of searching I finally landed on this project . The issue that I found is upgrading enums to enum classes. I found this interesting because I worked on enums before but I never heard of a enum class, so it was new to me as well. As always I downloaded the code to test what it can do before messing with the code. I followed the README to setup my windows environment to compile, build and run the code. I got to compile the code however I couldn't get pass the build phase. At this point, the best option is probably to move on to a different project but I didn't want to let go of such an interesting issue/enhancement. So I went back to the README and see if I have other options, it seems Linux/MacOS have less work to do building this project. I wanted to try using Macs to build this but I don't have any apple products. Then it hit me,

DPS909 release 0.3 PR2

Based on previous blog post: here . My second pull request was a simple fix but a huge bug. It all started when I was working on my previous issue . At school, I downloaded the zip file for SenecaBlackboardExtension from GitHub and ran it on Firefox to see what we have working so far. It had an email login and the "did you know" box was taken out. It was getting near the end of class so I decided to work on the first issue at home. Once I got home I updated my forked repo and test the extension again on Firefox and... it didn't change the page and no errors were displayed. So I quickly went to check the repo to see if any new pull request was merged. There was changes but 1 of the changes was on the readme file and the other change was on the manifest file which was for icons. The change to the readme file shouldn't have affected it so I tried reverting the change in manifest but the extension still didn't change. I then used "blame" from GitHub to s

DPS909 release 0.3

For my open source class at Seneca, we are now at a phase where we can start creating our own open source project. After both class have brainstormed brilliant ideas, 12 of the most popular ones are created. From the 12 projects, I was interested in two of them. The first one was the SenecaBlackboardExtension project because as a user I know best what could be improved. The other project that interest me was the Turn-based creative writing web app . The first issue that I created on SenecaBlackboardExtension was a great idea suggested by my professor(David Humphrey), which was to include a details/summary block to show/hide things on the site, instead of removing everything from the website. The first place I thought of using this was the Seneca Services box, since all the links in the box are important but only a couple are used most often, so I decided to add a collapsible view for the links that aren't used as often in the issue I've created.

My hacktoberfest 2018 journey reflection

During the Hacktoberfest month I have worked on these issues: https://github.com/theelous3/asks/issues/87 https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4907 https://github.com/filerjs/filer/issues/551 https://github.com/cjlcarvalho/crazy-robots/issues/18 https://github.com/cjlcarvalho/crazy-robots/issues/20 https://github.com/cjlcarvalho/crazy-robots/issues/2 What I have learnt:       I have realized that 5 pull requests may not seem like a big number to do but to do that in a one month of time, it's more than you'd think. At first I completed an issue during the first week so things were going as planned. During the first week, I also got to learn a new programming language(Python) mostly just to understand the part that I was working on. Once I got to the second issue, I got stuck at setting up the environment, it took about 1-2 weeks and I was still getting errors while trying to build the code. That is when I decided I should push this issue of

My fifth Hacktoberfest 2018 journey

If you have followed my previous Hacktoberfest contributions you would know where this one's going. Previously on my third issue, I have tried to improve the performance of a program which didn't go well because the owner of the repo didn't want to use global variables, that is why my fifth issue will help him remove the existing global variables.

My fourth hacktoberfest 2018 Journey

My fourth PR was based on the previous repo that I have worked on. I chose this project because of three things. I was familiar with what it does and the code. It is a small project and that there was lots that can be improved. I created an issue to give more details on the README for the users and for the future developers to use. Details on what is needed to run and the expectations.

My third Hacktoberfest 2018 Journey

This issue I created was suggested by a nice guy(Nate) who already finished 5 PR's. The idea was to increase the performance of a robot program. Instead of using the size method, a global variable would be used to keep track of the remaining robots for a quicker comparison when needed. This program was in C++ which made it very easy for me to read since that is one of my strength. The owner of the repo later told me that he didn't want to use global variables.

My second hacktoberfest 2018 Journey

My second hacktoberfest issue was the fastest I have ever started an issue. I didn't have to look for it, it came to me! The issue was based on my previous contribution to filerjs . Apparently, the test case that I have created for filer had no method implementation! The reason I didn't pick up on that when I created the test was because I forgot to add the file to the test index. Although the code compiled perfectly with no errors, the test was not actually being tested.

My first Hacktoberfest Issue/PR

For my first Hacktoberfest related issue and Pull Request(PR), I was looking for a simple documentation issue to start off easy and ramp up later on. I came across one that I found interesting which was modifying an example in the README file . Since it was a README file, I thought the coding language wouldn't matter for me when I picked it to work on. I found that the example they wanted was quite similar to the method that was already implemented. So I sent a PR to update the file and the owner of the repo wanted the example to be executable. At that moment I knew it was going to be harder than I expected because the code was written in Python, which I had not used before. So starting like a beginner, I had to search for ways to compile and execute Python code. But I keep running into websites that say Python code "doesn't need to be compiled" or "automatically compiled" so that got me confused for a day or two. I ended up with downloading different softwa

First time contributing to a open source project

The first open source project that I have contributed to is filer.js. The hardest part of contributing to an open source project was "Where do I start?". Our professor has gave us two options to where to start. 1. Finding a bug to fix. 2. Creating a test case for an existing function. I chose the second option because I feel that it would be harder to find bugs. Getting Set up: To look at existing test cases, I would have to physically look through the code so I downloaded the project on to my computer. I thought about using Visual Studio, the code editor I use for C++  and Java but filer.js is JavaScript so I decided it's time to try a different code editor(one that starts up faster on my computer). I downloaded one called "Atom" and the start-up was a lot faster comparing to VS and when I opened the project, the directories were perfectly lined up on the left side so I started searching for the test files. Looking for test cases that I could potentially

Node.js

Node.js filesystem: ReadFile vs ReadFileSync ReadFile fs.ReadFile() takes 3 arguments: 1. The first argument this function takes is "path" Path takes in a string, integer or an URL for the filename or file descriptor. 2. The second argument this function takes is "options" Options can take in a string to indicate a specific encoding of a file 3. The last argument it take is a "callback" Callback takes in a function that is used for error handling or continue the program. ReadFileSync For this version of ReadFile it only takes  2 arguments: The first two arguments are the same as fs.ReadFile() it takes the path and options. Now the main question is when is it time to use one over the other? For this question you would need to ask yourself "Do you need to do things at the same time or do you need the program to wait until you finish a part?" If you needed to run the whole program then you would need to use the fs.ReadFile()