Friday, September 27, 2019

Hacktoberfest 2019

Introduction


     For Hacktoberfest 2019 I have decided to work on googles open source issues. The projects that caught my eye to them are blockly-gamebullet-physic SDK and the quickdraw dataset. Blockly-game is a series of educational games that teach programming. It is based on the Blockly library. Bullet-physic SDK is real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning, etc. The Quick Draw Dataset is a collection of 50 million drawings across 345 categories, contributed by players of the game Quick, Draw. All of these projects are handled by Google and run on c++, a language I like to work with.

     My original goal for Hacktoberfest was to learn Python or Dart. Instead, I switched my goals to google because these projects caught my attention. Plus as a beginner, some of the issues these projects have to offer are stuff I can handle but also challenge my self later on. In quickdraw, I saw an issue about adding a heart to the database because it is easy to draw and recognized by everybody, which is something I can handle. On the other hand, we have collision issues with light objects in bullet physic SDK, something a bit out of my comfort zone but I would like to solve.

     Not gonna lie, I am super excited about Hacktoberfest, I cant wait to get started!


Pull Request 1 -TicTacToe


     For my first hacktoberfest entry I decided to work on something I was familiar with and help me settle in with this challenge, a tic-tac-toe game developed in java. The author of this repository was having some problems with win conditions for a vertical line. He created an issue for it and I helped him out and sent in a pull request. I have made tic-tac-toe when I was first learning to program from scratch, which is a block-based visual programming language. I thought I made it before this issue should be easy to solve and the fact that I am pretty knowledgeable working in java environment I was super sure ill have this issue don’t in 5 min. But I thought wrong. Finding the bug took some time to find but since all the files and variable names made sense it didn’t take too long like some projects I saw on GitHub where their file names and variable name were like “a, b, culm, z, zz”.  Also, the part of understanding the logic of the code and how everything works together and writing code that fits the author's coding style took some time to. The issue was fairly simple to fix because there was a fatal flaw in his check conditions, so once I fixed that the game ran smoothly. Another thing that caught me off guard was instead of using a window and using some graphics to display the game in java, the author decided to show all that in the terminal with was a pain to work with. This is because every time you chose to put a markdown you have to enter in the column and row number then it creates a new grid with the mark on it, This I found very irritating. Other than that I was very happy with this project is the first project I decided to work on as hacktoberfest entry.


Pull Request 2 – Quiz-Game


     For the second entry in hacktoberfest I decided to work on a quiz game built in java. I know I decided to switch my original goal and work on google based projects but in the end my drive to learn a new language took over and I started learning python. This quiz game was a great step towards my learning process. This game is simple enough that once I learned a bit of python I was able to follow what was going on in the code. At first, it was hard to understand of course, just like any new thing you attempt is hard, so I decided to sit down and learn python3 for 2 weeks. I used codecademy and stackoverflow to learn python3. Then I went back and the quiz code was easier to understand and understood that the author kept the coding were simple because they could have used more advanced techniques to do half their coding. The issue I solved in this game was a documentation and consistency issue in the game. The phrases that repeated in the game like “Enter your Choice”, “Enter Choice” or “Enter answer”, I decided to change all that and make it all the same as ““Enter your Choice” followed by the valid inputs so it looks like this in the end “Enter your Choice [a, b, c, d, e]: ”. I had to add in the valid answers because the game did not handle the wrong input very well all the time. Once I went and fixed all the documentation errors in the program I sent in a pull request. This issue helped me understand python better because if you can read and edit code in a certain language it will help you write code in that language as well.


Pull Request 3 – Algorithms


     For the third entry in hacktoberfest I decided to work on writing programs in python even if they are small ones. So, I came across this repository that has algorithms in c++ and python. The author had an issue open for mathematical algorithms in python so I took a crack at it. The author had a lot of the c++ algorithms done but the python ones very few and even those were done by other contributors so I decided to work on the factorial one. The program I wrote takes two inputs from the user than calculates the factorial in a while loop in a try and catch block to handle invalid input and prints the output of the calculations. After I wrote the code I sent in a pull request to merge it with their repositor. The thing I had a lot of problems with when I was writing was with the spacing and blocking everything. Since there are no brackets I got lost a lot when I was tiring to read my code since I couldn’t tell if it was the end of the if statement or loop. Other than that I had fun writing the program and it was so easy to write and run compared to doing it in c++ in visual studios.


Pull Request 4 - Algorithms


     For the fourth entry in hacktoberfest I decided to continue working on the same repository as pull request 3, Algorithms. This time around I sent in an issue to work on another one of the mathematical algorithms, highest common factor, and lowest common multiple. Same thing as PR3 it took two inputs and printed the output. What is different in this one is that I create two functions that I call upon and print what they return instead of just doing the calculation and printing out the variable value. After I wrote the code I sent in a pull request to merge it with their repositor. The thing that I had difficulties with this code was the actual logic for calculating the HCF&LCM. This is middle school math and I forgot about it totally so to remind me of how they work was the hardest. Other than that I enjoy working with python because it is so convenient and easy to use. It’s almost like coding by speaking.


Conclusion


     In the end, this was very fun and a great experience for me. I loved learning and working with python and I will continue to learn more about it in the near future. I know I didn't stick to the original projects that I planned on working on but I do not regret one bit of that. I will attempt solving some issues in those repositories in the near future as well. Also, I will attempt hacktoberfest next year as well since I enjoyed learning new things very much.

Monday, September 23, 2019

Github First Actual Experience

     Wow-what an experience getting full hands-on first Github project. Last lecture class in DSP909, I learned some git commands which I had a lot of fun playing around with, messing stuff up and finally getting to the destination which I originally set out to reach. I will talk about that later on. On the first release out of the four for the course, we had to 1. fix a bug on one of our classmates lab_2 programs which we wrote and pushed to GitHub last week and 2. add a new feature to another classmates lab_2 program and get it pushed to Github.

     I was excited to do this but 1 thing I didn't keep in mind that my professor told me to never to do in this course at the beginning of the course year was to keep the release work for last minute because they take time to complete. When I started working on it I had problems finding other classmates bugs because lab_2 was very simple, creating a notepad. After a while, my friends suggested trying to open the notepad in different browsers and see if that helped me find a bug. At the end that was a bust. So I decided to take a more general approach to this and see if I could enhance someone's notepad to make it look better and function more efficiently. At last, I found a notepad like that. One of the biggest problems with the notepad I found was I didn't know where the text area was because there was no placeholder to tell the user where to type their notes or a border during their text field.
When I first opened the notepad I kid not, I clicked on the screen like 4 times before I found the text box so I put in an issue with the creator of the notepad and asked to fix the problem. After that, I went ahead and added a border and apparently the code had a preassigned text to the text box at the start of opening the notepad but it wasn't showing up so I fixed that problem by taking it out and placing a placeholder in the div of the text field and placed in a pull request. After last weeks struggles with javascript I remembered a lot more of how to work with javascript this time around. So I was really grateful for that.

    The second part of this release was a lot easier than the first part. Adding a new feater to a simple notepad program I found easy because originally there weren't that many features added so you can add anything as long as what I added did not break the whole, notepad program. So I decided to add a save button for the paranoid that didn't trust in the autosave functionality and clear button for the people who want to start over. Along with that, I added a clear short cut, ctrl+c since the notepad had a save shortcut, ctrl+s. It's only fair that there should be a clear shortcut if there is a save shortcut right? So I started with putting an issue in with the creator and the creator was thrilled with it and replied instantly. So I added the feature and submitted and a pull request so he can merge it with the master branch and he did. This was a lot less time consuming than finding a bug fix.

     On a sided note from the release I tried out the following git commands on the terminal:
               - git inti
               - git status
               - git show
               - git diff
               - git rm
               - git checkout
These commands gave me a lot of difficulties trying to figure out what was going on. At one point I was trying to override a .git file from another git staging and it was not fun. Also, I was thinking of cloning the same repository from git again because this was giving me a lot of problems but I remembered that I can undo almost anything on git and I browsed for while on google. After I was able to reverse my staging to the local working directory and everything was fine or so I think it is fine.

Wednesday, September 18, 2019

NotePad

Note Pad a simple but can be a complex program. I have recently created a notepad program, a very basic one. All it does is, it allows the user to type in whatever they feel like and autosave the page every 2 seconds. So upon refreshing the page whatever the user typed in is still visible, didn't delete itself. Along with that I have added 2 buttons, save and clear. For the users who don't know about the autosave, they can press the save button to save their text and the clear button if the user wants to start over for whatever reason.

I haven't touched web programming in a long time now and I forgot most of the syntax or how to do something. So for this lab, I looked a lot of what I need on W3Schools.com. They have a lot of tutorial for HTML, CSS, javascript and more. Also, the good thing about this website is that it has interactive examples. So you can run a snippet of code and play around with it to get a feel of how it works and how you can incorporate it with your project.

All in all, this was a good refresher lab for web development.

Monday, September 9, 2019

Open Source Real Time Voice Cloning

     Today I was talking to some friends while playing ping pong and we were talking about voice cloning so we don't have to always respond to our moms calls for chores. Instead, we can clone our dad's voice and playback a recording that tells our mom to let the kids enjoy and do our thing. That got me thinking and I searched if anything like this was available or being working on Github to do as my first assignment on for Topic in Open Source Development course I am taking this semester. Luckily there is. I found a repository that uses deep learning framework that allows creating a numerical representation of a voice from a few seconds of audio. Which later is used in a condition for text-to-speech resulting in a cloned voice to say what you enter into a text box.

     I was drawn to this the second I came by it but I was a bit against choosing this as my topic for my assignment since it was done in python. It makes sense to do it in python because of deep learning and useability but I have never used python before at all. So this could be a problem for me. In turn, I thought about killing two birds with one stone, learning python, semesters gonna be crazy busy now and work on something I like.