teleren/devto huggingface dataset:
Entering Open Source Community - HacktoberFest'21
Tags: hacktoberfest, beginners
Published: 2021-10-02 05:45:54

### Introduction
Hey all, I am Srinjoy, a CS Student who wants to learn about the open source technology by contributing to projects.

### Background
I have some knowledge in coding and complete noob in open source contribution.I learnt about Hacktoberfest from my friends and decided to use this opportunity to learn about git(especially pull requests, merging)and open source.

### Progress
I have decided to contribute to repos based on Data structure and algorithms. 

Looking forward to a productive month!!.
Deploying a Next.js application on Vercel
Tags: nextjs, react
Published: 2021-10-02 05:35:47

Seeing that the fantastic creators of Next.js created Vercel, it's the smartest choice to go with Vercel as your Next hosting.

They make the process super easy!

## Deploying a Next.js application on Vercel

To get started deploying your app on Vercel, follow along with these steps:

1. Visit the [Vercel website and sign up](https://vercel.com/signup) (I used GitHub as the provider)
2. From the import project, choose your GitHub project
3. Since it's a Next.js project, everything will be set correctly. We have to choose a team and click the deploy button
4. Visit your project online 🎉

You can find my deployed version here:

[Next Tailwind project on Vercel](https://next-tailwind-lake.vercel.app/)

And that's how easy it can be!
Even on other hosts like [Netlify](https://netlify.com/) the process is quite similar and easy to follow.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
React : useEffect() Hook in React/ReactJS
Tags: javascript, beginners, react, tutorial
Published: 2021-10-02 05:27:19

* What is useEffect() Hook 

* When & How to use useEffect() 

* How useEffect works with State & Props changes 

* How to fetch data using useEffect

<b>Timeline :</b> 

00:00 Introduction 

00:24 What is useEffect() Hook 

01:00 Counter example with lifecyles of class component 

03:27 Counter example with Functional component 

05:05 useEffect() hook defination 

06:04 prevent useEffect to run on each render 

06:55 UseEffect with State changes 

10:18 UseEffect with Prop changes 

14:15 Fetch data from service using useEffect

{%youtube i3iAqZW3Wig%}
{Insert Hacktoberfest 2021-Related Title Here}
Tags: hacktoberfest
Published: 2021-10-02 04:51:19

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->


### [Intro Heading]
<!-- If you are new to the DEV community, introduce yourself and share a bit about why you joined DEV and decided to participate in Hacktoberfest this year.  --> 

### Background

<!-- Are you brand new to open source? What about coding in general? Tell us about how you got here →

### Progress

<!-- Share a bit about where you’re at in your Hacktoberfest journey. What stage are you at? How has the process been?  -->

### Contributions

<!-- This is where you can list the contributions you made and explain why you chose the projects you did. Don’t forget to add links!  -->


### Reflections
<!-- Overall, how has your Hacktoberfest 2021 experience been? If you’re a first-timer, will you participate again? What have you learned? Have you made any interesting connections? What is your next step in open source?  -->
Contribute to your favourite resume builder this Hacktoberfest! 🎆
Tags: hacktoberfest, typescript, webdev, react
Published: 2021-10-02 04:32:50

[Resuminator](https://www.resuminator.in) is participating in [Hacktoberfest 2021](https://hacktoberfest.digitalocean.com/), hosted by DigitalOcean 🥳

We invite all developers and designers to contribute to Resuminator this October 2021 by opening new [issues](https://github.com/resuminator/resuminator/issues), sharing your thoughts in our [discussions](https://github.com/resuminator/resuminator/discussions), or by submitting a pull request (PR) against any Hacktoberfest labeled [issue](<https://github.com/resuminator/resuminator/issues?q=is%3Aopen+is%3Aissue+label%3AHacktoberfest>) 🙌🏻

## How can you participate?

> For your convenience, we have opened an issue [here](https://github.com/resuminator/resuminator/issues/95) to track all the Hacktoberfest related issues :smile:

First of all we'd be super glad to see your interest in participating in this year's Hacktoberfest with us.
We have different levels of issues and multiple ways of contributing to our codebase.

We are accepting code contributions on mainly three repositories

* [resuminator](https://github.com/resuminator/resuminator) - The main web-app and website codebase.
* [resuminator-server](https://github.com/resuminator/resuminator-server) -
The backend code which handles the data retrieval for the app.
* [docs](https://github.com/resuminator/docs) - Documentation and Wiki for Resuminator and its products
(The line you are reading comes from this codebase)

> For a quick overview of **tech stack** - we use React, Next JS, TypeScript, Node JS and MongoDB along with other
packages which you may read about [here](/docs/developer-guide/tech-stack)

## Doubts and Queries?

In case of any doubts or queries, feel free to tag any of our maintainers on any of the GitHub issues for their domain.

* [@viveknigam3003](https://github.com/viveknigam3003) - Frontend, Website, Design, General Issues  
* [@merrcury](https://github.com/merrcury) - Backend, DevOps, Dev Setup, Docs

If you want to reach out to us, you can also ping us on Twitter [@resuminator](https://twitter.com/resuminator) OR reach out to us on our Discord Server using [discord.resuminator.in](https://discord.resuminator.in)

See you there! :v: 
Happy Hacktoberfest! 🎉
Hacktoberfest 2021
Tags: hacktoberfest, beginners, devops
Published: 2021-10-02 04:11:25

THE GOOD, THE BAD and THE UGLY

I am going to be honest, I have been focusing on completing my law degree.  The last 2 years of this degree has been 'brutal'. As such, I have not had the time to focus on the fun stuff like coding.  So, Hacktoberfest is a big deal for me.  It not only gives the opportunity to 'stay in the game of coding' but it also gives me that little breather from studies.

I have participated in 2 Hacktoberfest.  Last year, I ran an event to inspire other people to get involved with Hacktoberfest.  Over 250 people showed up for an online tutorial. *SHOCK 

Notably, this year has had its challenges.  I know I am not the only one.  The hard times teaches us compassion and empathy. So, for me, Hacktoberfest is about joining a fun community, celebrating a month of code, inspiring others on the amazing things you can do in the developers world, and forget about any challenges you may have had this year.  

Over the past 2 days I have given Hacktoberfest a real go.  I decided I wanted to do a little more this year, so I decided to do some fun stuff with code.  I have to admit, I am not an expert coder.  I would definitely class my self as a beginner compared to the rest of the amazing developers. 

At first, I did a github search for #hacktoberfest2021.  After I completed a few PRs, I found the projects weren't not participating in this event.  Oddly, they have 2021 in their project.  I went back to the Hacktoberfest QA folder and read the instructions again.  I noticed that I needed to add commentary.  So, I looked for some others, added comments but again..rejection.  I went back to the Hacktofest page and decided to choose beginner.  Clearly I have not learnt anything so I should start from scratch.  No luck.  Then, I thought, let me try DEV.  I found a post which lead me to a page which set out instruction.  Ironically, I went to the page that said "Participating in Hacktoberfest" and choose one.  But, the same thing happened. 

So, all in all, I have completed 11 PR.  One is still to be accepted.  One project is excluded and the rest is 'project not participating'.

There were some rules that said that maintenance can say 'SPAM', which is a concern because it is never my intent to ever do that.  So, if anyone has any ideas, or can #help with a few projects that I can partake it, I would be grateful.  Otherwise, I may just need to take a back seat and let this year's Hacktoberfest pass by. :(
Git Merge and Git Branch 
Published: 2021-10-02 03:58:46

This week , I had to continue my work on my [Shinny-SSg](https://github.com/hphan9/shinny-ssg) application by adding two new features and practicing git merge on parallel branches. It was a long week for me and I did not really have time to go over all of the OSD600 course material. Luckily, the features were easy to implement and I got only one conflict when trying to do three-way recursive merge for my readme file.
## New Feature
The first one I implement is adding an [optional -l, --lang](https://github.com/hphan9/shinny-ssg/commit/f9943a56029bf17db3f28154cbe7dc7fb8ccbe8a) for my application. Basically, it will let user specify which language attribute they want to use for html file. For example: -l fr will add lang= "fr" to the html file. It was not hard to implement and I just needed to modify the Page class and added a command option in the main function. 
The second feature I add is the [exit code](https://github.com/hphan9/shinny-ssg/commit/6b0c23c2a4caa7066b360f4e844353e9b2975da9) for the application. 
## Git Merge
I had used Git merge and Git checkout command many times before, but I never truly understand it. In the past, every time I got a problem with git merge , I just found a temporary solution on the Internet and fixed it. And this process just made me so nervous when I have to do Git merge on a project. However, after watching the video on Git merge by Prof. David and practicing doing it in my own repository, I feel more confident with my Git skill and working in big project with multiple branches. 
## Issue and Solution
This is the first issue I have when doing Git merge from 2 different history branches: main and issue-13. I resolved it with removing conflict in my code and [commit](https://github.com/hphan9/shinny-ssg/commit/7ee965281712788a23eee40272aeabeeb6d32fb2) the change. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6k7925gfra40k6uu843.png)
Resolving merge conflicts
Tags: opensource, cli, node, gitmerge
Published: 2021-10-02 03:55:23

I continued working on my commandline-ssg application this week, adding two new features and performing git merge on parallel branches. The features were simple to implement, and then when I sought to conduct a three-way recursive merge for my readme file, I only had a few of conflicts to deal with.
##New features
I selected two features to work on for this week. the features are as follows:
###Exit code
I started it by creating [issue]( https://github.com/ritikbheda/commandline-ssg/issues/10). Then I created a branch called `issue-10`. I then started with coding and added exit statements on every places where program do not run further or do not run as expected. I [committed]( https://github.com/ritikbheda/commandline-ssg/commit/bea4fd1c556845d481f0b58d19411f5dbf279310) the code and later I updated the README.md file and [committed]( https://github.com/ritikbheda/commandline-ssg/tree/48bb819dea46f73663b445633ae5e4bb455f3d8f) it as well.
###Language support
I started by creating [issue]( https://github.com/ritikbheda/commandline-ssg/issues/11). Then I created a branch called `issue-11`. I then started with coding and my solution to it was introducing a new option with a default value of `en-CA`. I then edited all the occurrence of the language in the HTML code. Later, my code looked a little mess so all I now had to make it look prettier and easily understandable for a developer. My solution to it was passing only one function argument instead of 4. I updated the README.md file and committed everything. This is the [commit]( https://github.com/ritikbheda/commandline-ssg/commit/d1802228477c07d4a3a71a7eebae534f9e53660a) link.
##Merging the code
I first merged the `issue-10` which was `fast-forward` meaning I did not have any merge conflicts or anything to deal with. It was an easy process. But after that, I tried merging the `issue-11` to my master branch but it had merge conflicts in a couple of files. I solved them in one file, I did keep both the changes while in the second, I have to keep a mixture of both. This [commit]( https://github.com/ritikbheda/commandline-ssg/commit/25331ade49210952568a219fb110d5d988fd5da3) is resolves the merge conflicts. The master branch now has code from both issue-10  and issue-11 branches and both the branches are not already deleted.
##Learnings
All these events taught me something really valuable. I can do my best to perform them more regularly now that I know how simple a fast forward merging is. My approach to resolving disputes is lot more hopeful now that I understand how 3-way merges occur and may be rectified. After reading this explanation of what a 3-way-merge is, I realize that the worst-case situation isn't necessarily the case. I feel more secure addressing merge disputes now that I understand how this works.

### Other links
[Project Repo](https://github.com/ritikbheda/commandline-ssg)
[My GitHub account](https://github.com/ritikbheda)
Learning Python- Intermediate course: Day 36, Summary of the week
Tags: learningpython, python, tutorial
Published: 2021-10-02 03:54:27

### Summary of the week
- [Day 33](https://dev.to/aatmaj/learning-python-intermediate-course-day-33-the-menu-widget-5g5l) We learnt about the menu widget in Python. The menu widget is used to create dropdown menus for application commands. 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9c4kpjrmgs57oq04oada.png)

- [Day 34](https://dev.to/aatmaj/learning-python-intermediate-course-day-34-toplevel-panedwindow-and-message-widgets-44l6) We covered three widgets, top-level, paned window and the message widget. The toplevel widget is used to represent some extra information, pop-up, or the group of widgets on the new window. The toplevel windows have the title bars, borders, and other window decorations. The Paned Window widget acts like a Container widget for holding many widgets in place. The message widget is similar to the label widget and is used to display messages.

- [Day 35](https://dev.to/aatmaj/learning-python-intermediate-course-day-35-messagebox-widget-19c8) We covered the message-box widget. The message-box widget is used to to display popup messages with different signs and symbols for specific instances of messages like errors or warnings. It can also be used to ask question to user in a yes/no format.
Merging to main branch and Working on different branches
Published: 2021-10-02 03:42:46

In this lab, I created two issues for supporting [Horizontal rule-Issue#21](https://github.com/suhhee1011/suhheeKim_OSD_release0.1_create_ssg/issues/21) and [Code Block-issue#22](https://github.com/suhhee1011/suhheeKim_OSD_release0.1_create_ssg/issues/22) in Markdown to HTML tags on [my static site generator repository](https://github.com/suhhee1011/suhheeKim_OSD_release0.1_create_ssg). 

First I created two branches called [Issue-21](https://github.com/suhhee1011/suhheeKim_OSD_release0.1_create_ssg/tree/issue-21) and [Issue-22](https://github.com/suhhee1011/suhheeKim_OSD_release0.1_create_ssg/tree/issue-22) to write the codes on the different branches and merge them together to learn how to merge different branches into one repository. Writing code was going quite smoothly compare to previous labs. After I push it to each of the branches, I merged with the master branch. 

For this lab, it seems like all parts of the lab went smoothly. Unfortunately, I found that I also pushed unnecessary files and folders such as node_modules, text, and MD files that were used to create a static webpage and created HTML. Because I want to make it clean, I tried to remove the fixed code from the code and push it again to make it the previous version. 

After that, I tried to edit both branches and merge them. Unlike the previous version, there was an error. It says that it is non-fast-forward, so, it cannot merge it to the main bridge. Hence, I tried the same step again to find which part cause the error. But after I tried these steps again, it successfully did merge it to the master branch! 

It took me a long time to fix it, it took a full day to make the repository correctly. For next time, I will try to check again before I commit and push the code to the repository. I think it was possible to solve because it was my repository and my work does not affect other's work. However, when I am working on other's directories, it can cause an error on the application.
lab3 fast-forward merge and three-way recursive merge
Published: 2021-10-02 02:36:06

This week we practiced fast-forward merge and three-way recursive merge. I pick two features to do lab3. **The first feature** is adding an optional -l, --lang flag which indicates the language to use. **The second feature** is adding support for horizontal rule in Markdown. 
### Create two branches
* create two issues which are [issue-9](https://github.com/Yoda-Canada/Magic-SSG/issues/9) and [issue-10](https://github.com/Yoda-Canada/Magic-SSG/issues/10). The two issues correspond the two feature respectively.

### Add First Feature
1. This feature is adding an optional -l, --lang flag, which indicates the language to use when generating the lang attribute on the root <html> element, and I edit the feature in branch issue-9. 
2. I search the information about the "argparse.ArgumentParser()" method, and add four attribute which can achieve the aim. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3i0qrd24bcnazv3j8arv.png)
3. Add new argument - lang informat_to_html function and html_template.
4. Fast-forward merge the first feature. [issue#9](https://github.com/Yoda-Canada/Magic-SSG/issues/9), [02598ce](https://github.com/Yoda-Canada/Magic-SSG/commit/02598cea1db16aa5e25298b943c923df7ce976a0)
5. Modify readme and add instruction about how to use -lang.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2g83twliivxk4tw8z90.png)

### Second Feature
1. This feature is adding support for a horizontal rule in Markdown. The Markdown “---” should get converted to an “hr” tag. I edit the feature in branch issue-9. 
2. This feature is based on the lab2 and it bothered me because my partner's lab2 couldn't run, and the added structure was different from my original structure. I merged partner's cod in a new branch, and I rewrite the lab2 in my main branch.  After that, I create a  new branch issue-10 and add a new regular expression which search for "---".
3. Three-way recursive merge the second feature. [issue#10](https://github.com/Yoda-Canada/Magic-SSG/issues/10), [cc8099d]
(https://github.com/Yoda-Canada/Magic-SSG/commit/cc8099d9bb84df685bbe926661e0c70bbf5b72f3)
4. There is a conflict when I merge the issue-10 because I changed a regular express. I delete the origin regular express in main and replaced by issue-10's.

### The problem I'm solving
> At present, the main problems to be solved are how to effectively read the file line by line and how to use regular expressions correctly. So I learned tow videos, and try to modify my coding. [Reading and Writing to Files](https://www.youtube.com/watch?v=Uh2ebFW8OYM&t=980s), [How to Match Any Pattern of Text](https://www.youtube.com/watch?v=sa-TUpSx1JA)
Merging Branches with Git
Tags: git, javascript, github, webdev
Published: 2021-10-02 03:13:46

Welcome to my blog post about merging multiple features with my personal project! This time around I will be talking about the two new features I added to the [Octo project](https://github.com/LuigiZaccagnini/octo). The two new features I added are:

- [Support for a horizontal rule in Markdown](https://github.com/LuigiZaccagnini/octo/issues/10)
- [Support for language attribute](https://github.com/LuigiZaccagnini/octo/issues/9)

And I also fixed this issue:

- [Don't both with @author annotations in comments](https://github.com/LuigiZaccagnini/octo/issues/6)

## Dealing With The Merges 
To start, I started to create three separate branches for each individual issue to work on. I found working like this allows me to isolate issues and focus on what I need to work on for each issue. I added support for the horizontal rule in Markdown and support to change the language attribute. Merging the branches was seamless since I organized the branches to issues. The only difficult part of adding these features was reviewing the merges and making sure I wouldn’t overwrite any important parts of the code. 

## Conclusion
In conclusion, I learned a lot about adding features and working with branches and issues. If I were to do this again I would want to organize the way I merge branches in a way that causes less conflicts. If you want to find any of the merges and issues I fixed they will be down below. Don't forget that [hacktoberfest](https://hacktoberfest.digitalocean.com/) has started! Sign up at the link I provided and join the fun! Thank you for reading and do not forget to contribute to open source!

### Links to issues and pull requests
[Add support for a horizontal rule in Markdown](https://github.com/LuigiZaccagnini/octo/issues/10)
[PR](https://github.com/LuigiZaccagnini/octo/commit/a36bcf87ad6341aece8569157276a87e4cf68ec9)
[Support for language attribute](https://github.com/LuigiZaccagnini/octo/issues/9)
[PR](https://github.com/LuigiZaccagnini/octo/commit/acbfa904cb9536d0be98937a626e0f9de29bb461)
[Don't both with @author annotations in comments](https://github.com/LuigiZaccagnini/octo/issues/6)
[PR](https://github.com/LuigiZaccagnini/octo/commit/2875fa8aa9a5abb3820529d7d962ab005a98ebcc)
BinarySearch - Longest Increasing Path
Tags: programming, binarysearch, cpp, tutorial
Published: 2021-10-02 02:43:55

[https://binarysearch.com/problems/Longest-Increasing-Path](https://binarysearch.com/problems/Longest-Increasing-Path)

## Problem

Given a two-dimensional integer matrix, find the length of the longest strictly increasing path. You can move up, down, left, or right.

Constraints

n, m ≤ 500 where n and m are the number of rows and columns in matrix

## Solution

DFS Approach.

dp[i][j] means the length of longest increasing path starting from (i,j). Traverse four directions iff the next cell is in the bound and the value is greater than the current one. Calculate it recursively and store it back to dp[i][j]. If dp[i][j] has been calculated, return the cached result directly.

```cpp
int m, n;
vector<vector<int>> dp;

int dfs(vector<vector<int>>& matrix, int i, int j) {
    if (dp[i][j]) return dp[i][j];
    int v = 1;
    if (i + 1 < m && matrix[i + 1][j] > matrix[i][j]) v = max(v, 1 + dfs(matrix, i + 1, j));
    if (i - 1 >= 0 && matrix[i - 1][j] > matrix[i][j]) v = max(v, 1 + dfs(matrix, i - 1, j));
    if (j + 1 < n && matrix[i][j + 1] > matrix[i][j]) v = max(v, 1 + dfs(matrix, i, j + 1));
    if (j - 1 >= 0 && matrix[i][j - 1] > matrix[i][j]) v = max(v, 1 + dfs(matrix, i, j - 1));
    dp[i][j] = v;
    return dp[i][j];
}

int solve(vector<vector<int>>& matrix) {
    m = matrix.size(), n = matrix[0].size();
    dp = vector<vector<int>>(m, vector<int>(n, 0));
    int ans = 0;
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            ans = max(ans, dfs(matrix, i, j));
        }
    }
    return ans;
}
```