teleren/devto huggingface dataset:
Git 101: Git for Beginners
Published: 2022-12-19 05:57:59

Hey there!

If you're new to the world of programming, you've probably heard the term "Git" thrown around a lot. But what is Git, and why is it so important?

In this tutorial, we're going to cover the basics of Git so you can get up and running as quickly as possible.

First things first – what is Git? Simply put, Git is a version control system that helps developers track changes to their code. It allows you to collaborate with other developers on a project and keep track of every change made.

Now that we have a basic understanding of what Git is, let's talk about how to get started.

To use Git, you'll need to have it installed on your computer. You can download the latest version of Git from the [official website](https://git-scm.com/). Once you have it installed, open up a terminal or command prompt and run the following command:

<pre>git config --global user.name "Your Name"
git config --global user.email "your@email.com"
</pre>

This will set your name and email address for Git. Make sure to replace "Your Name" and "your@email.com" with your own information.

Next, you'll need to create a repository. A repository, or "repo" for short, is a place where you can store your code and track changes. To create a new repository, navigate to the directory where you want to store your code and run the following command:
<pre>git init</pre>
This will create a new Git repository in the current directory.

Once you have a repository set up, you can start tracking changes to your code. To do this, you'll need to "add" and "commit" your changes.

To add changes to a repository, use the git add command followed by the name of the file you want to add. For example:
<pre>git add main.py</pre>
This will add the main.py file to the staging area, which is a holding area for changes that are ready to be committed.

To commit changes to a repository, use the git commit command followed by a message describing the changes you made. For example:
<pre>git commit -m "Added new feature"</pre>
This will commit the changes in the staging area to the repository, along with a message describing the changes.

Now that we've covered the basics of Git, let's talk about some other useful commands.

**git status**: This command will show you the status of your repository, including any changes that have been made but not yet added or committed.

**git log**: This command will show you a history of all the commits made to the repository.

**git diff**: This command will show you the differences between the current version of a file and the version in the repository.

**git clone**: This command will create a local copy of a repository from a remote location.

There are many more Git commands out there, but these are some of the most important ones for beginners to know. With a little practice, you'll be a Git pro in no time!

I hope this tutorial has been helpful in introducing you to the world of Git. Happy coding!
Remove Invalid File uploaded to input type=file in JavaScript
Tags: javascript, jquery, file, beginners
Published: 2022-12-19 05:50:30

Here input parameter is the html element, span is label for filenames.
```
var readURL = function (input, span) {
    var text = "";
    let fileName = "";
    let isValid = false;
    var files = $(input)[0].files;
    var fileArray = Array.from(files);

    for (var i in files) {
        if ($(files)[i] && typeof $(files)[i]['name'] != "undefined") {
            
            fileName = $(files)[i].name;
            isValid = checkFileValidation(fileName);

            response.fileName.push(fileName);
            response.valid.push(isValid);

            if (isValid) {
                text += " " + $(files)[i]['name'];
            }
            else {
                fileArray.splice(i, 1);
            }
        }
    }
    $(input)[0].files = new FileListItems(fileArray);

    if (text == "") {
        text = "Upload";
    }
    $('#' + span).text(text);
};
```

```
var validFileExtensions = "^.*\.(pdf|jpg|jpeg|gif|png|bmp|doc|docx|ppsx|ppt|pptx|xls|xlsx|7z|zip|rar|csv|txt|rtf|m4a|mp3|mpeg|avi|mpeg4|real|wav|swf|wma|msg)$"
var checkFileValidation = function (fileOrFileName) {
    //Check whether the file is valid file.
    var regex = new RegExp(validFileExtensions);
    if (regex.test(fileOrFileName.toLowerCase())) {
        return true;
    } else {
        return false;
    }
}
```
Using Git to track down deleted code in a large project
Tags: git, beginners, tutorial, abotwrotethis
Published: 2022-12-19 05:47:20

> My code is now deleted in file A around line 800, and I do not know when it was deleted. How to find the person who deleted my code from git?

TLDR;
``` zsh
# Search from line
git blame -L 800,800 A

# Search from text
git log -S "CODE_TO_SEARCH" A
```

To find out who deleted code from a file using git, you can use the `git blame` command. This command shows the last commit that modified each line of code in a file, along with the author and date of the commit.

To see the commit that deleted a specific line of code, you can use the `git blame` command with the `-L` option, which allows you to specify a range of lines. For example, to see the commit that deleted code around line 800 in file A, you can use the following command:

``` zsh
git blame -L 800,800 A
```

This will show the commit that modified line 800 in file A, along with the author and date of the commit. If the code was deleted in this commit, it will also show the line of code that was deleted.

You can also use the git log command with the `-S` option to search the commit history for a specific string of code. This can be helpful if you don't know the exact line number where the code was deleted.

For example, to search for the commit that deleted a specific string of code from file A, you can use the following command:

``` zsh
git log -S "CODE_TO_SEARCH" A
```

Replace `CODE_TO_SEARCH` with the string of code you want to search for. This will show a list of commits that include the specified code, along with the commit message and any other information about the commit.

Surprise, this article was generated by ChatGPT!
Group By Query In Laravel 9 Example
Tags: laravel, php, mysql, codenewbie
Published: 2022-12-19 05:30:00

In this article, we will see group by query in laravel 9. Here, we will learn how to use group by query in laravel 9. 

As you might expect, groupBy and having methods may be used to group the query results. 

learn how to create a collection of data using the laravel groupBy method. It can allow us to group the data by type, id, date, etc. Also, you can group by count and group by multiple columns.

Also, we will give you an example of a laravel 9 group by with where condition and query of the group by in MySQL. 

The GROUP BY statement is often used with aggregate functions COUNT(), MAX(), MIN(), SUM(), AVG() to group the result set by one or more columns.

So, let's see the laravel 9 group by query, how to use group by in laravel 9, laravel 9 group by with where condition and laravel 9 group by multiple columns.

> SQL Query:

MySQL Group By Syntax with where condition.

```
SELECT column_names
FROM table_name
WHERE condition
GROUP BY column_names
ORDER BY column_names;
```

Example:

```
SELECT COUNT(user_id), country
FROM users
GROUP BY country;
``` 

---

**_[Read Also: Order By Query In Laravel 9 Example](https://techsolutionstuff.com/post/order-by-query-in-laravel-9-example)_**
 
---

> Laravel 9 Group By Query:

The “groupBy” function belongs to the collection, not an eloquent category.

```
use App\User;
use DB;

public function index()
{
    $users = User::select("*", DB::raw("count(*) as user_id"))
                    ->groupBy('country')
                    ->get();
}

``` 

> Laravel 9 groupBy() with having() Query Example:

The having method's signature is similar to that of the where method.

```
$users = DB::table('users')
                ->groupBy('account_id')
                ->having('account_id', '>', 100)
                ->get();
``` 

> Laravel 9 groupBy() with Date

Now, we will give examples of the group by date.

```
DB::table('users')
      ->select(DB::raw('DATE(created_at) as date'), DB::raw('count(*) as views'))
      ->groupBy('date')
      ->get();
```

In this example, we will group by year with the help of the DB::raw function.

```
$users = User::select("*", DB::raw("count(*) as user_count"))
                        ->groupBy(DB::raw("year(created_at)"))
                        ->get();
```

---

You might also like:

**_[Read Also: Laravel 8 Left Join Query Example](https://techsolutionstuff.com/post/laravel-8-left-join-query-example)_**
**_[Read Also: Laravel whereBetween Query Example](https://techsolutionstuff.com/post/laravel-wherebetween-query-example)_**

---

If this post was helpful, please like, share and comment✌️.
Reasons You Should Go with Custom Custom CRM Software Development Today
Published: 2022-12-19 05:18:51


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1stihfmji722tno25j8.png)
The customized CRM system is developed in accordance with the needs and specifications of the relevant business so that the employees of the particular company. Starting **[Custom CRM software development](https://www.apptunix.com/solutions/build-custom-crm-software/)** from scratch may seem very difficult but it actually takes less time to modify such a suite that meets your specific requirements. In the current corporate environment, CRM software has been able to establish itself as the most effective professional option.
Python 101: How to Create and Use Virtual Environments
Tags: python, django, beginners, tutorial
Published: 2022-12-19 05:14:25

Hey there!

In this tutorial, we're going to go through the process of setting up a virtual environment in Python. But first, let's talk about what exactly a virtual environment is and why it's useful.

A virtual environment is essentially a tool that allows you to create separate Python environments on a single machine. This is really handy when you're working on multiple projects that might require different versions of packages or modules. By using virtual environments, you can isolate the dependencies for each project and ensure that they don't interfere with one another.

Okay, so now that we know what virtual environments are and why they're useful, let's get started setting one up.

To create a virtual environment, you'll need to have Python 3.3 or a later version installed. Once you have that, open up a terminal or command prompt and navigate to the directory where you want to create your virtual environment. Then, run the following command:

<pre>python3 -m venv myenv</pre>

Make sure to replace "myenv" with the desired name for your environment. This will create a directory with the specified name that contains the Python executable and other necessary files for the virtual environment.

To activate the virtual environment, run the following command:

<pre>source myenv/bin/activate</pre>

Again, be sure to replace "myenv" with the name of your virtual environment. You'll know that the virtual environment is active when you see the name of your environment in parentheses at the beginning of your terminal prompt.

To deactivate the virtual environment, simply run the deactivate command.

Once you've got your virtual environment set up and activated, you can start installing packages using pip. For example, if you wanted to install the numpy package, you would run the following command:

<pre>pip install numpy</pre>

This will install the numpy package in your virtual environment, and it will only be available for use within that environment. If you switch to a different environment or deactivate the current one, the numpy package will no longer be accessible.

So, to sum up, virtual environments are really useful for isolating dependencies and packages for different projects, making it easier to manage and share your code. They also allow you to create a reproducible environment for your project, which is especially handy when you're working with other people.

I hope this tutorial has been helpful in explaining how to set up a virtual environment in Python and the benefits of using them. Happy coding!
45 Days of Leetcode - Find Pivot Index - Day 3.1
Published: 2022-12-19 05:05:55

Hey dev! In case you don't know, I've started #45daysofleetcode and in these 45 days i'll be writing about two problems every day.

> The problem, how I solved it and a bit of detailed explanation.

I'm sharing this progress with you so that you too can learn a bit of different perspective and have new solutions so hit like to join this journey.

I've chosen the best list of problems from medium to hard. That made lots of developers crack the interview.

Are you excited?

**Today's Problem**

**Name**
Find Pivot Index

**Description**
Given an array of integers nums, calculate the pivot index of this array.

The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum of all the numbers strictly to the index's right.

If the index is on the left edge of the array, then the left sum is 0 because there are no elements to the left. This also applies to the right edge of the array.

Return the leftmost pivot index. If no such index exists, return -1.

## Example

```
Input: nums = [1,7,3,6,5,6]
Output: 3
Explanation:
The pivot index is 3.
Left sum = nums[0] + nums[1] + nums[2] = 1 + 7 + 3 = 11
Right sum = nums[4] + nums[5] = 5 + 6 = 11

```


## My Approach
We will iterate through the array, and at each index, we check if the sum of the left side of the index is equal to the sum of the right side of the index.

## Code

```
class Solution:
    def pivotIndex(self, nums: List[int]) -> int:
        total_sum, right_sum, left_sum = sum(nums), 0, 0
        for i in range(len(nums)):
            right_sum = total_sum - nums[i] - left_sum
            if left_sum == right_sum:
                return i
            left_sum += nums[i]
        return -1
```



Let me know if you've any questions or suggestions!.

If you want full list of solutions, [here's the list.](https://github.com/Anas-Dew/dsa-coding-solutions) Make sure you star the repository.

Follow to join this #45daysofleetcode
Bye!
Correção ortográfica em português no VSCode utilizando o Code Spell Checker
Published: 2022-12-19 04:46:35


## _
### Atividades

1 - Instalar a extensão Code Spell Checker.
2 - Instalar o dicionário Brazilian Portuguese.
3 - Configurar a extensão e habilitar o dicionário

-

#### `1/2- Instalando as extensões`

Utilize o atalho para acessar a aba de extensões do vscode:

>Teclas: Ctrl + Shift + X

![aba de extensões do vscode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h54eun668swu6j8i6uyy.png)


Já na aba de extensões, faça:


1- Procure por `Code Spell Checker` clique na opção para visualizar o menu da extensão, faça a instalação e também verifique se está habilitada por padrão, para saber mais acesse a pagina do [[marketplace](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)].

![Logo em verde com o titulo da extensão e as opções](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mdg5xms9a606h36jtq4s.PNG)

2- Repita as instruções anteriores desta vez procurando por `Brazilian Portuguese`, para saber mais acesse a pagina do [[marketplace](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker-portuguese-brazilian)].

![Logo em verde com o titulo da extensão e as opções](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12om26snhzmq3adbzwv6.PNG)

-

#### `3- Configurando`

Utilize os atalhos para acessar o console do vscode:

>Tecla: F1

ou

>Teclas: Ctrl + Shift + P

No console do vscode comece a digitar `Show Spell Checker Configuration Info` e visualizará as opções.
![console do vscode e algumas opções](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pb20xe2nd90hv6i5u1lz.png) 

Selecione a opção correta e o menu de configuração ira aparecer. Ele é composto por um menu superior na cor azul contendo as seguintes opções:

**USER:** Controla as configurações de toda as instancias do vscode.  

**WORKSPACE:** Controla as configurações quando um workspace esta aberto.

**FILE:** Visualiza  o arquivo aberto e os dicionários ativos. 

**DICTIONARIES:** Mostra todos os dicionários instalados na extensão.

**ABOUT:** Refresh e DebugMode.

![menu de configurações com a opção user selecionada](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h3hf5n5546fxubunijw.png)

Para configurarmos vamos acessar a aba `USER` e selecionar o dicionário desejado, neste menu procure pelo o `Brazilian Portuguese` e deixe a opção ativa. 

Perceba que em cada alteração um console será mostrado com as opções `USER` e `WORKSPACE` e você precisa definir para qual deles vai a configuração atual.

Selecione `USER`

Após a configuração acesse a aba `ABOUT` do menu de configurações e acione o botão para efetuar o refresh da extensão. Verifique se as configurações permaneceram corretas e abra um arquivo para testar.

> imbigo adevogado mortandela árvre :) 


-
> **Nota:** Ao deixar o mouse sobre o erro aparecerem algumas opções, na opção `Quick Fix` encontramos as possibilidades de correções.
Extend Business Logic
Published: 2022-12-19 04:20:07

Database record 
```

INSERT INTO CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION, CLASSNAME)
VALUES(<storeent_id>, 'com.ibm.commerce.security.commands.LogonCmd', NULL, 'com.<myorg>.commerce.security.commands.ExtLogonCmdImpl');

```
Bồn Composite Tân Phát
Published: 2022-12-19 04:16:22

https://bonnuoclapghepcomposite.com Bồn chứa hóa chất Composite✔️ Bể nuôi cá Composite✔️ Bồn Nước Lắp Ghép Inox✔️ Bồn tự hoại Đại Thành Bồn Composite✔️✔️✔️
0988757424
tanphatfrp.sales@gmail.com
12/6H Đường Tân Hiệp 9, Ấp Thới Tây 1, Xã Tân Hiệp, Huyện Hóc Môn – TP.Hồ Chí Minh.
https://www.facebook.com/congty.tanphatfrp
https://twitter.com/boncompositetp
https://www.pinterest.com/boncompositetanphat/
https://www.youtube.com/@boncompositetanphat/about
Interview: Basic Horizontal Nav Bar
Tags: webdev, html, css, angular
Published: 2022-12-19 04:11:26

It's like this:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ip1p9nfwyfk35xq3duy.png)

Here is the code:

Mostly self explanatory:

```html
<ul class="list">
    <li *ngFor="let item of list">{{item}}</li>
</ul>
```

```scss
.list {
    list-style-type: none;
    margin: 0;
    padding: 10px 0;
    border: 1px solid grey;
    margin: 5px 5px 0 5px;
    > li {
        display: inline;
        padding: 11px;
        border-right: inherit;
        opacity: 0.7;
        &:hover {
            background-color: grey;
            opacity: 1;
        }
    }
}
```

Thanks,
[Vishwak](https://twitter.com/urstrulyvishwak)
Best 5 Staking Tokens Prospect Dominate In 2023 According to analytics
Tags: staking, tokens, analytics
Published: 2022-12-19 03:53:13

Best 5 Staking Tokens Prospect Dominate In 2023 According to analytics
During down markets, when crypto investors would rather hold on to their money, staking tokens become more frequent.
#staking #Crypto #investors 
published: true
tags: defi,analytics,staking,tokens
canonical_url: https://dev.to/abreakz369/best-5-staking-tokens-prospect-dominate-in-2023-according-to-analytics-181l/

SEE MORE:
[https://www.abreakz.com/high-5-staking-tokens-that-will-dominate](https://www.abreakz.com/high-5-staking-tokens-that-will-dominate)
What Is the Future for Manual Testing? | Career in Software Testing | Manual to Automation Switch.
Tags: webdev, beginners, programming, tutorial
Published: 2022-12-19 03:30:23

In This video, I am going to share my views on the What is the Future for Manual Testing? and How You can too switch from Manual to Automation Testing.

{% embed https://youtu.be/2Rr3mmRuJ2w %}

These are just my personal view with over 8+ years of Experience in Manual and Automation Testing. 

✅ Download the Mind Map - 
https://go.scrolltest.com/29HC


✅30 Days of Automation Testing
 https://go.scrolltest.com/automation


✅30 Days of API Testing 
 https://apitesting.co/30days


✅30 Days of Rest Assured
 https://go.scrolltest.com/30days-rest...


- First Thing you need to ask your self is are you really a Great Manual Tester?, Do you know all the Manual Testing concepts like Test Plan, Design and Execution.

If not you must visit http://www.testingeducation.org/BBST
 to learn about the concepts first and then move to other job.

In this video, I have uncovered some of the Career in Software Testing switch that you can do after manual testing.

What is Manual Testing?

MANUAL TESTING is a type of Software Testing where Testers manually execute test cases without using any automation tools. Manual Testing is the most primitive of all testing types and helps find bugs in the software system. Any new application must be manually tested before its testing can be automated

How do I switch from manual tester to automation?
https://www.quora.com/How-do-I-switch...


-----------------------------------------------------
👪 Join our Community - http://bit.ly/learntesting2019

✅ Automation Tester Community - https://thetestingacademy.com

🐦Follow us on Twitter  - https://twitter.com/itstechmode

📖 Like us on Facebook - https://www.facebook.com/scrolltest

🎤  Listen to our Podcast - https://anchor.fm/thetestingacademy

------------------------------------------------------

#manualtesting #automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest

🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅ API Testing - 
https://www.learnapitesting.com


✅ Cypress Tutorial with LIVE Projects -
http://cypresstutorial.com