teleren/devto huggingface dataset:
Regular Expression Matching Leetcode Python Solution
Tags: regularexpression, python, leetcode, leetcodesolutions
Published: 2022-01-26 10:25:09

LeetCode has a Medium coding Problem in Its’ Algorithm Section “Regular Expression Matching Leetcode Python”. Today We are going to solve this problem. LeetCode Link of the Problem is HERE.

![Uploading image](...)

Question
Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where:
'.' Matches any single character.​​​​
'*' Matches zero or more of the preceding element.
The matching should cover the entire input string (not partial).
Examples
Input: s = "aa", p = "a"
Output: false
Explanation: "a" does not match the entire string "aa".
Input: s = "aa", p = "a*"
Output: true
Explanation: '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".
Input: s = "ab", p = ".*"
Output: true
Explanation: ".*" means "zero or more (*) of any character (.)".
Constraints:
1 <= s.length <= 20
1 <= p.length <= 30
s contains only lowercase English letters.
p contains only lowercase English letters, '.', and '*'.
It is guaranteed for each appearance of the character '*', there will be a previous valid character to match.
Solution to Regular Expression Matching Leetcode Python
The Solution to the problem in python is here https://hecodesit.com/regular-expression-matching-leetcode-python-solution/
Day 86 of 100 Days of Code & Scrum: MySQL, Next.js, and Building Webpages
Tags: 100daysofcode, javascript, webdev, beginners
Published: 2022-01-26 10:23:18

Hello there, everyone!

This week, I'm planning to learn more about SQL, MySQL, Next.js, and Scrum, as well as finish building the Terms of Use and Privacy Policy pages for my website. Maybe I will deploy the updates at the end of the week, if they are ready.

Anyway, let's move on to my daily report!

## Yesterday

I did my 12th Weekly Sprint Review and Retrospective, in which I went over what I've managed to do well, what my shortcomings were, and what I could do better in the future.

## Today

I set up my weekly Sprint Goals, which will focus on learning SQL/MySQL Next.js, Scrum, and SWR, and updating my website.

## Weekly Sprint Goals

### Company Website

- code the content and design of the Terms of Use and Privacy Policy pages for my website.
- deploy the updates after fixing any bugs and cleaning up the styling for them.

### SQL/MySQL

- learn more SQL concepts by going through [SQLZoo's SQL Tutorial](https://sqlzoo.net/wiki/SQL_Tutorial).
- familiarize myself with the tools of MySQL and how to use them.

### Next.js

- continue learning by reading the Next.js documentation.
- continue going through [Next.js & React by Maximilian Schwarzmüller](https://www.udemy.com/course/nextjs-react-the-complete-guide/).
- learn SWR and go through the documentation.

### Scrum

- continue to learn more about Scrum, through reading articles and watching videos.

Thank you for reading! Have a good day!

![Rammina Thank You Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9ayfxxxaz2g2hfcqbsk.png)

## Resources/Recommended Readings

- [SQLZoo's SQL Tutorial](https://sqlzoo.net/wiki/SQL_Tutorial)
- [Next.js & React by Maximilian Schwarzmüller](https://www.udemy.com/course/nextjs-react-the-complete-guide/)
- [Next.js official documentation](https://nextjs.org/docs/getting-started)
- [SWR official documentation](https://swr.vercel.app/)
- [The 2020 Scrum Guide](https://scrumguides.org/scrum-guide.html)

## DISCLAIMER

**This is not a guide**, it is just me sharing my experiences and learnings. This post only expresses my thoughts and opinions (based on my limited knowledge) and is in no way a substitute for actual references. If I ever make a mistake or if you disagree, I would appreciate corrections in the comments!

<hr />

## Other Media

Feel free to reach out to me in other media!

<span><a target="_blank" href="https://www.rammina.com"><img src="https://res.cloudinary.com/rammina/image/upload/v1638444046/rammina-button-128_x9ginu.png" alt="Rammina Logo" width="128" height="50"/></a></span>

<span><a target="_blank" href="https://twitter.com/RamminaR"><img src="https://res.cloudinary.com/rammina/image/upload/v1636792959/twitter-logo_laoyfu_pdbagm.png" alt="Twitter logo" width="128" height="50"/></a></span>

<span><a target="_blank" href="https://github.com/Rammina"><img src="https://res.cloudinary.com/rammina/image/upload/v1636795051/GitHub-Emblem2_epcp8r.png" alt="Github logo" width="128" height="50"/></a></span>
How to push the Project into the git repo.!
Tags: github, git, javascript, beginners
Published: 2022-01-26 10:21:51

## Solution
**Create repo into the GitHub profile**

- Then type the command in sequential order.

- first create .gitignore file and then 

```
 git init

 git add .

- git commit -m "Initial commit"

- git remote add origin path http

- git branch -m main

- git push -u origin main
```

## how to remove git from project

- rm -rf .git
[PT-BR] - Criando Relatorios CSV com VueJs/NuxtJs
Tags: webdev, javascript, programming, tutorial
Published: 2022-01-26 10:13:00

Para quem me acompanha na [Twitch](https://twitch.tv/em1dio) sabe que eu estou fazendo um projeto financeiro. (Já fica a propaganda, lives de segunda a quinta das 17h as 20h).

Uma dos recursos que mais tive vontade de implementar, seria guardar relatórios em formato csv.

## Solução Encontrada
Estava procurando solucões e encontrei essa [vue-json-to-csv](https://www.npmjs.com/package/vue-json-to-csv)

Gostei por que é simples e fica facil.

## instalacao

Como qualquer projeto basta usar o npm
```bash
npm install vue-json-csv
```

ou o yarn ...
```bash
yarn add vue-json-csv
```

## Utilizando no VueJs

```html
<download-csv
    :data= "json_data">
    Download Data
    <img src="download_icon.png">
</download-csv>
```

```js

// Essas 3 próximas linhas sao necessárias apenas dentro do vuejs.
// No nuxt isso ja é incluido/renderizado no plugin. 
// (Basicamente, é so sair usando)
import Vue from 'vue'
import JsonCSV from 'vue-json-csv'

Vue.component('downloadCsv', JsonCSV)

const app = new Vue({
    el: '#app',
    data: {     
        json_data: [
            {
                'name': 'joe',
                'surname': 'Roe',
            },
            {
                'name': 'john',
                'surname': 'Doe',
            }
        ]
    }
})

```

## Usando no Nuxt.js
Para usar dentro do Nuxt.js temos que colocar alguns passos a mais.

## Criar um plugin

```js
// ../plugins/jsonToCsv.js

import Vue from 'vue'
import JsonCSV from 'vue-json-csv'
 
Vue.component('downloadCsv', JsonCSV)
```

## Atualizar o nuxt.config.js
```js
// nuxt.config.js
// incluir dentro de plugins

  plugins: ['~plugins/jsonToCsv.js'],
```
## Resultado
Se baseando na documentacao oficial o resultado do .csv seria

Nome do Arquivo: My_CSV.csv
```csv
name,surname
joe,Roe
john,Doe
```

link do pacote para mais detalhes[
](https://www.npmjs.com/package/vue-json-csv)

Esse post, tambem foi postado na [comunidade da Hub](https://ahub.tech)
VUE cli with electron
Tags: vue, electron, javascript, tutorial
Published: 2022-01-26 10:07:18

I remember the days when JavaScript simply ran hover effects on buttons and made my page a little more interactive. Ahh the good old days before the many frameworks and crazy things we are now doing with good old JS!

But a project came up recently that required a desktop application which I have never made. How do we do it I thought, I mean I’m a web developer, not an app developer! So after picking my flavor of JavaScript frameworks a few years ago I wondered if there was a way I could use VUE.js as my sword of choice and build this app and thanks to Electron that is all very possible. 

Shall we have a go? Now before we jump in I’m going to assume you have used VUE before and are familiar with NPM/Yarn and the terminal. So with that all done let’s get started. 

First and foremost we need to get [VUE Cli](https://cli.vuejs.org/) installed which we can do by running the following.

```
npm install -g @vue/cli
```

Then we need to create our app. When you move forward it will ask you which flavor of VUE you want to use and for this tutorial, we are going to use VUE 2. So go ahead and run the following in your terminal to create an app. Options like Eslint, babel, and separate js files are your personal choice so I’ll leave the full flavor up to you.

```
vue create electron-app
```
![Vue cli starting selection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e151434q5nqirh1ypnn7.PNG)

Next we need to install Electron, to do this simply install the VUE electron package as so.

```
cd electron-app
vue add electron-builder
```

With that done we now need build our little app out by running the following code. You will get asked for a version and for this set up we are using version 13.0.0

![Vue electron version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3jfh6wved14eeo0myhce.PNG)

Lets now run to serve our app so we can see it in all its wonderful glory!

```
npm run electron:serve
```

![Electron served](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbclk1i1gos14b53vdzh.PNG)

We now have our desktop app all up and running and ready to code something cool. Now imagine we have a fully fledged JavaScript app with all its wonderful abilities running in a desktop environment. Pretty cool right?

Now if you want to build out the app to install, run the following code

```
npm run electron:build
```

Now if we head over to our file explorer you will see we have a dist folder and contained here is our build with an installer, a bundled and non bundled version all ready to test out!


![Vue electron build finished](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmn2lozmwz7y6z7qs64w.PNG) 

There is so much more we can do with config files and such but for now have a play and see what you think, maybe try building out a few different apps, use vuex and connect to an api! It’s a satisfying way to develop.


And for you visual learners check out the video below!

[![Vue in laravel 8](http://img.youtube.com/vi/iSAYEj8YqQw/0.jpg)](http://www.youtube.com/watch?v=iSAYEj8YqQw)
Deploying Vite App to GitHub Pages
Tags: vite, githubpages, git, deploy
Published: 2022-01-26 10:00:56

##GitHub Pages

You can use GitHub Pages to showcase some open source projects, host a blog, or even share your resume. This will guide you to get started on creating your next website.[Github-pages](https://pages.github.com/)

It will create a website with a domain, `username.github.io`. Eg. Let's consider your `username` as **peter101** and your `repo` name as **OnTheGo**. Then it will make a website with the domain `peter101.github.io/OnTheGo/`.


##Steps for the Deployment


The following steps must be followed in serial-wise.

We will create a seperate `gh-pages` branch that will contain our _/dist_ folder.



####Push your code to your repository (using Terminal)


- cd to your Vite App.
- Run the following commands in your Terminal
   2. `$ git init`
   3. `$ git add . `
   4. `$ git commit -m "first-commit"`
   5. `$ git branch -M main`
   6. `$ git remote add origin http://github.com/username/repo-name.git`
   7. `$ git push -u origin main`



Now, you will able to see your code in your repository.


####Deploying (Static)


1. Go to your `vite.config.js` file. And add your base url to it.



![Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c88yz7o768blhaipaioy.png)



To be more precise, your base url will be **/repo-name/**. 
In my case, my `repo-name` is `Tech-To`. So, my base url will be **/Tech-To/**.


2. Run `npm run build` in your Terminal.

>By default, the build output will be placed at dist. You may deploy this dist folder to any of your preferred platforms.


3. Add _/dist_ folder into your repo. By running.
```
$ git add dist -f

```

`-f` is required, as your **.gitignore** will not consider your _/dist_ folder. Hence, it is required for git to consider it as well.


4. Run `$ git commit -m "Adding dist"` in your Terminal.


5. Run `$ git subtree push --prefix dist origin gh-pages`


##Your Deployed website


- Visit your repository.
- Go to Settings.
- Scroll down to **Pages**.
- There will be a link to your website.


####You did it!!



![congo](https://media.giphy.com/media/g9582DNuQppxC/giphy-downsized-large.gif)

![congo](https://media.giphy.com/media/xT0xezQGU5xCDJuCPe/giphy.gif)




>#####Thank You for referring to this post. Your comments will be helpful for the betterment of this post.
100 Days Of Reactjs/ JavaScript
Tags: javascript, beginners, programming, codenewbie
Published: 2022-01-26 09:59:55

I want to use this medium to announce that I will be starting my 100 days of code.
This is my first time trying this challenge although I wanted to do it last year but some things came up so I didn’t.
 Here are my daily expectations:
- Each project should have a repo on GitHub 
- Each day I will work on a project of any size and push to GitHub 
- Each day I post a blog about the project i make.

This won’t be easy but I will definitely try my possible best to make this work and am sure by seeing this you are also encouraged to start yours too.
Thank you.
Counter App
Published: 2022-01-26 09:48:06

Hello, I'm Egwuenu precious I just recently started the [100daysofcodechallege](https://www.100daysofcode.com/). Well, this is my first day of and I created a Counter app which is made with (HTML,CSS,JAVASCRIPT)

In order for me to have made this project I basically watched some youtube videos and also read some article online and it really helped me which i didn't even spend up to an hour. I will be dropping some resources down below:
[here](https://www.codespeedy.com/counter-project-in-javascript)
 
My counter app [Here](https://preshpi.github.io/counter/)
I had fun making this project which was easy and simple i look forward in making more and more.
Thanks.
What really is "__name__" (A Special variable) in Python🤔?
Tags: python, programming, codenewbie, 100daysofcode
Published: 2022-01-26 09:44:26

Are you a Pythonista? if so, let's clearly dive into what **"\__name__"** and **"\__main__"** really is and how it works.

Let's say you've this code in **file1**:

```
# File1.py 
  
print ("File1 __name__ = %s" %__name__) 
  
if __name__ == "__main__": 
    print ("File1 is being run directly")
else: 
    print ("File1 is being imported")
``` 

And of course this one in **file2**:

```
# File2.py

import file1

print("File2 __name__ = %s" % __name__)

if __name__ == "__main__":
    print("File2 is being run directly")
else:
    print("File2 is being imported")
```

if you run file one the output will be:

```
File1 __name__ = __main__
File1 is being run directly
```

And if you run file2 output will be:

```
File1 __name__ = file1
File1 is being imported
File2 __name__ = __main__
File2 is being run directly
```

If you've seen the output carefully, the **\__name__ ** is a built-in variable which evaluates to the name of the current module.

#### You may ask why it sometimes returns **\__main__**🤔?,

If the current script is being run on its own, the \__name__ variable returns **__main__ ** and if the script is imported the \__name__ will returns module name.

REMARK: \__name__ is always a string datatype.

Let's consider example above if you run file 2, the **\__name__** variable in file1 will be _file1_ because that's the name of module we are importing, and **\__name__** in file2 will be _\__main___ as it's the module we're running.


You can use the \__name__ variable a get name of a class you've imported. example
```
from player import Player

print(Player.__name__) 
# OUTPUT: Player
```

To summarize all we said above, The \__name__ variable (two underscores before and after) is a special Python variable. It gets its value depending on how we execute the containing script.

Thanks to this special variable, you can decide whether you want to run the script. Or that you want to import the functions defined in the script.
First Project :)
Published: 2022-01-26 09:35:05

Hey, hope you guys are doing well.  I'm new here and also to the community :p.
Here is something I coded as a beginner project.

<iframe height="300" style="width: 100%;" scrolling="no" title="ChatApp" src="https://codepen.io/whitewolfdot/embed/GRORaNx?default-tab=css%2Cresult" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
  See the Pen <a href="https://codepen.io/whitewolfdot/pen/GRORaNx">
  ChatApp</a> by WhiteWolfDot (<a href="https://codepen.io/whitewolfdot">@whitewolfdot</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>

I know the code is not that great. Also I'm not good at back-end languages, someone please explain the best language I can use for this project. Thanks in advance.
To-Do Lists
Tags: discuss, improvement, todo, lists
Published: 2022-01-26 09:19:59

---
title: To-Do Lists
published: true
description: To-Do lists are great
tags: discuss, improvement, todo, lists
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjmv9eslncsopz18grq9.jpg
---

_Originally published on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/to-do-lists/)._

> To-Do lists are great. It doesn't matter if it's on paper, in a native app, or a web app, or a hybrid app (anyone still remembers those? 🙂), or on a blockchain, or... (sorry, got carried away). The important part is that you at least try them out if they're not a part of your daily routine yet.

---

This is [why I write](https://www.nikola-breznjak.com/blog/daily-thoughts/why-do-i-write-these-daily-thoughts-posts/) these 'daily thoughts' posts.
Component Library for React by Folody Team
Tags: react, library, reactcomponent
Published: 2022-01-26 09:18:00

Component Library for React by Folody Team

**Install**

```
npm install patery-ui-components
```

```
yarn add patery-ui-components
```

**Try Latest and Beta**
```
npm install patery-ui-components@latest
```

You can  Install from Replit Package and Glitch package

[NPM](https://www.npmjs.com/package/patery-ui-components)
[Github](https://github.com/Folody-Team/components)
[Discord Community](https://dsc.gg/folody)

Author : @phatdev12
Best Books for Programming 
Published: 2022-01-26 09:09:15

If you are new to programming, teaching yourself by reading books is an excellent way to learn. 
The ability to read and understand a programming book will help you explain your code and write better software and can design better [website](https://www.calvinduderussia.com/). 
The following are some of the best resources for beginner programmers, which include great introductory textbooks as well as tutorials for more experienced developers who need a refresher course on their respective platforms.

1) "Learn Python The Hard Way" - A free guide to learning Python from scratch that doesn't depend on a single textbook.. 
2) Using Microsoft Visual Studio 2015 with C# - This series of 10 videos covers important topics in C#, including arrays and collections, event handling, LINQ queries and more.
Using react-query with NextJS router
Tags: react, javascript, nextjs
Published: 2022-01-26 09:08:53

---
title: 'Using react-query with NextJS router'
published: true
description: React query is a fantastic tool which I've really enjoyed using recently. But we found a few times where we have been using it in close conjunction with multiple requests where it seemed to be returning the same dataset for different queries. Here's what was going on.
tags: react, javascript, nextjs
---

**Tanner Lindsey's [React Query](https://react-query.tanstack.com) is a fantastic tool which I've really enjoyed using recently. But we found a few times where we have been using it in close conjunction with multiple requests where it seemed to be returning the same dataset for different queries. Here's what was going on.**

Here are the two queries I wrote:

```javascript
    const data = useReactQuery(
        id,
        getData(id)
    );

    const moreData = useReactQuery(
        id,
        getMoreData(id)
    );
```

In this case, we were fetching data from 2 different endpoints, but when we inspected the data, it seemed to us as if we had made only one API call.

The problem was that we are using the same `key` for each of the queries:

```javascript
    const data = useReactQuery(
        'data',
        getData(id)
    );

    const moreData = useReactQuery(
        'moreData',
        getMoreData(id)
    );
```
Using unique keys for each request is in fact [well documented on the docs site](https://react-query.tanstack.com/guides/query-keys).

## Query keys and NextJS routing

I encountered a similar problem when using keys similar to the above on two different pages in a NextJS application. After the original query had been run we did a `router.push()` to a new page, and had another `useQuery()` on the next page which used the same key as the previous page.

Again the same thing happened, it seemed to us as if we had made a mistake and mixed the fetch requests around. this happened because changing a route in a hydrated NextJS application only changes the application state, not the browser URL, which would have cleared the react-query state. Ensuring that the keys were unique fixed the issue here as well.
SICP 1.12 - Pascal Triangle using Recursion [C++]
Tags: sicp, recursion, programming, beginners
Published: 2022-01-26 09:02:01

Hello Devs!

Recently I started reading the programming wizard book - _Structure and Interpretation of Computer Programs_, solving through the exercises, thought I'll share them here.

The book uses scheme as the primary programming language. I used C++ but I still considered the limits of Scheme will writing the code in C++. For example, the absence of loops.

Here is the code to print the Pascal triangle only using a recursive method.

1. First, a recursive method to print all the columns

`void display_pascal_col(int n, int i) {
    if (i == n) return;
    display_pascal_row(i, 1);
    display_pascal_col(n, i+1);
}`

2. Now, within that recursive method there is another method which will print the row for that column in that particular iteration.

`void display_pascal_row(int row, int col) {
    cout << pascal(row, col);
    if (row == col) {
        cout << endl;
        return;
    }
    display_pascal_row(row, col+1);
}`

3. Every row value can be found using the classic Pascal Triangle recursive method. Concepts of dynamic programming can be applied with this method for optimization.

`int pascal(int row, int col) {
    if (row == 1 || col == 1 || row == col) return 1;
    return pascal(row-1, col-1) + pascal(row-1, col);
}` 

4. Find the entire C++ code below

```
#include <iostream>
using namespace std;

int pascal(int row, int col) {
    if (row == 1 || col == 1 || row == col) return 1;
    return pascal(row-1, col-1) + pascal(row-1, col);
}

void display_pascal_row(int row, int col) {
    cout << pascal(row, col) << " ";
    if (row == col) {
        cout << endl;
        return;
    }
    display_pascal_row(row, col+1);
}

void display_pascal_col(int n, int i) {
    if (i == n) return;
    display_pascal_row(i, 1);
    display_pascal_col(n, i+1);
}

void display_pascal(int n) {
    display_pascal_col(n, 1);
}

int main() {
    display_pascal(5);
	return 0;
}
```

That was it! 

I recently thought about writing as a part of self revision and to see how well I understand the concepts myself. So this is my first article or post out there. Thanks.