Friday 24 September 2021

OSD600 Lab 2 - Sharing and Forking

This week we are suppose to choose another student's SSG repo and provide initial support for Markdown files to be converted into html. and also implement at least one of the Markdown features (Italics, Bold, Header1, Header2 or a Link).  I decided to work with Oliver Pham's repo mainly because it was written in Python and I wanted to see a different version of what we are implementing.

Adding support by first creating Issue #10 on Silkie

Below is a sample code running,


The following is the sample output in html


 This is a hard problem to solve to convert .md to .html because there are multiple edge cases such that will break part of the code, validation of the html, not displaying correctly and a number of issues.  Working with this new python code, Oliver has done a great job in keeping the code clean and easy to understand by using the yattag library, which allow python to generate html.  I learned it the hard way that you are only as good a programmer as how well you understand the python libraries.  As you can see in my code my brute force attempt at the header styles of Markdown lead to unexpected results, and potential issues.  I decide to focus on making links work well as well as allowing the user to have any number of Bold and Italics text in a single paragraph.  The major problem is keeping track of where you need the paragraph tags in which I put one whenever I encounter a bold/italics text just in case that is the only bold or italics text.  I received helpful feedback from Oliver and his reject to my initial pull requests are rightly justified.  I realized the importance of fully testing the code and making sure something is working before pushing code to Github.  The collaborative effort in open source is pillared on good pull request, good communication and proper use of git.  Having Oliver working on my code on the other hand was a delight.  It is like work being done on your behalf. This is what open source is all about.

Next Time I'll be Ready



Wednesday 15 September 2021

Built a Command Line Tool to turn txt to html in Node.js

Intro

 For our first two weeks in OSD600 we had to build a command line tool to generate html given text files.  The requirements are as follows:

1. Options -h and -v flag are used to display help and version of the program

2. Mandatory -i specify file input or file folder - I implemented the option to recursively go through the folder as well as nested folders

3. Generate properly ,html files, where I always have a main index.html file plus zero or more *.html files

4. The generated html files are placed in the dist folder

5. Make a user friendly interface

Usage

1. clone the repository with git clone or download the .zip then unzip

2. Install node version 16 on your machine

3. Go to your folder

4. Run npm install -g .

5. for the command line tool run sggy -i <name of file or folder>

Example

Output


files and folders created


index.html


Sample test2.html

Repo


License






Tuesday 14 September 2021

Lab 1: Friend of Open Source

    I recently networked with a new friend named Kevan Yang on slack in the first week.  He is a passionate developer just like me in OSD600 and I knew we would be partners in crime and all things open source.  I have reviewed his code and even though his code is more complete than mine, I found an issue running it.  It did not properly generate the corresponding HTML file.  He fixed the code by running it recursively through the files, which again I tested half a day later and it works!

    I believe it all started on Tuesday of Week 1 when I had some of the code working, and I showed a demo of my code with libraries such as chalk, boxen, figlet to make decent look and feel to the command line tool as shown in the following.


    Kevan knew my repo and before you know it he used the same library for creating the title.  I was able to get him started, but his stylesheet code conversely blew me away and I borrowed his module generateHtmlTemplate.js with properly citing it as his work.  That is the beauty of Open Source like this at Seneca.

    Even if a project may not have a open source License file, it is still under exclusive copyright of the owner of the code.  In Kevan's case he has the proper license file and the readme is spot on with markdown just like mine.  It does not have typos or formatting issues.

    At first we had issue installing each other's code because I was on node 14 and he was on node 16, but later I updated my version and things are running fine.  He has the proper version, help, input, and the html generated correctly and placed in the .dist/ folder.  Through communication on Slack and video call on discord we were able to successfully run each other's code.

    His code at first was long and hard to understand but later in the week he fixed with much cleaner code.  I had my work cut of for me as I spent less time than Kevan on the code, but I learned a lot through the release of 0.1 because I used libraries I have never used.  It was interesting to see someone else's approach to the same problem.  I also checked out other people's repo in other languages like Rust and Python.  It was a fun journey in working with classmates on Slack.

My repo: https://github.com/ycechungAI/cmd-ssg

Kevan's repo: https://github.com/Kevan-Y/text-ssg

Cheers,

Eugene Chung

Monday 6 September 2021

My First Steps in Open Source

Hello World,

    My name is Eugene and this is my first blog post about things related to Open Source and the course OSD600 at Seneca college, which is all about Open Source projects.  The reason I am taking this course is because I mostly hit a wall in terms of contributing and starting open source projects.  I just not sure where to begin or how to approach large projects with millions of lines of code.  Sadly, many schools don't teach open source until upper year but hopefully in the future even high school students can get involved with open source technology.  

    I see software development as a growing and ever evolving trend even with powerful language models like GPT-3 which can automatically code for you based on natural language processing, I see this field as ever needed and in higher demand than ever.  Yes I got early access because I participated in a Hackathon by OpenAI. As you might have noticed, I am a machine learning enthusiast and trying to break some ground in the open source scene.  What is great about programming and all things open source is that there is no age restriction or major adverse risk as long as you are willing to code and dive into coding.  

    Due to the pandemic I am situated at home in Toronto, Ontario for many months now.  Also due to the pandemic I figured I get my computer programming two year college diploma first in case my situation changes and apply for co-op and see if I can get in CPAC (which I did).  My number one course I wanted to take for the advanced diploma CPAC is open source development OSD600.  I am hoping to get more comfortable with using git and being faster and more accurate at pushing code to Github.  I am keen on collaborating with other students in the course on various interesting open source projects. Besides machine learning, I wanted look into contributing to the Linux community, virgin open source projects as well as game development code. 

   The trending repository I chosen is the https://github.com/ycechungAI/nft-art-generator, which generates a piece of art work based on traits from given samples of artwork.  I feel we are at the point where non-coders are able leverage technologies like these to make interesting designs and art.  I believe there is an equality among art and science, where one should not over take another and this is the perfect example of merging of two realms.

Cheers,

Eugene Chung

What I learned from Project 1 of Udacity's Data Science with Python bootcamp

Introduction As part of the project I completed successfully, I used SQL to explore a database related to movie rentals. SQL queries was ran...