teleren/devto huggingface dataset:
6 reasons why to learn how to develop a WordPress plugin
Tags: wordpress, plugindevelopment, development, programming
Published: 2022-01-28 19:48:04

[The original article HERE
](https://peterteszary.hashnode.dev/6-reasons-why-to-learn-how-to-develop-a-wordpress-plugin)
Well, the main reason why I started to learn how to develop a WordPress plugin is a bit long story, and I am sure that many of you out there has similar experiences. Let me tell you mine.

## 1st reason:

So the first reason is that I have spent so much money on different plugins, for different problems to solve. 

## 2nd reason

The second reason is that I don't want to use a plugin for everything. So while you learn how to build a plugin, you will see that there are so much more and simpler options than just installing and using a plugin. For example, I am sure that instead of using 3 plugins for different purposes, you can surely add the scripts that those plugins are using into a code snippet, or add it to the functions.php. But that was just an example. The solution can be different in many ways. 

## 3rd reason

The third reason is that I want to understand, how these things are working. I create websites and webshops for a living, so I want to deliver the highest quality that is possible. So damn sure I have to dive in if I want to be good in it. 

## 4th reason

Fourth reason: I am studying every day to become a full-stack developer. It is a good practice as well. You can practice PHP, MySQL, HTML, CSS, Js, version control, and many other things, by just finding a solution to your problems.

## 5th reason

The fifth reason is to find a solution to your problems. Previously, I started to study plugins a theme development without a plan. I've just wanted to learn it, to be more professional. But It is much easier if you study it with an exact purpose. 

For example, I have many unfinished projects, because I lost my interest in them on the way. But after a period, I ran into some problems that pushed me to dive in again and again. And as soon as I had some "personal" problems to solve - for example, environment dependency problems while developing a theme - I had the motivation to keep going. 

Same with plugin development. I have bought several courses, to have a guided study curve. But it is just getting boring sometimes. Until you run into a "personal" problem in your everyday work. In my case something got my website slowing down, so I started to investigate in that way, till I found out there is no solution for my problems in that way that I want it to. So, let's develop a solution for it, that is personalized for my needs.

## 6th reason

The sixth reason. If you get good enough, and your stuff is working well, you can earn some money as well. Even if it is just a couple of dollars, it still feels good, to get paid for something that you have done for fun.  

So I guess if you are at the beginning of this road, you can pick one reason for this 6 above, and use it as a star in the night sky, so if you are lost, and out of motivation, maybe it helps to get you back on track!

Good luck!
4sum Problem Leetcode – Python Solutions
Tags: 4sum, 4sumleetcode, 4sumalgoirithms, 4sumsolutions
Published: 2022-01-28 19:46:49

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

4sum problem leetcode
Question
Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:

0 <= a, b, c, d < n
a, b, c, and d are distinct.
nums[a] + nums[b] + nums[c] + nums[d] == target
You may return the answer in any order.

Examples to 4sum problem leetcode
Input: nums = [1,0,-1,0,-2,2], target = 0
Output: [[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]
Input: nums = [2,2,2,2,2], target = 8
Output: [[2,2,2,2]]
Constraints:

1 <= nums.length <= 200
-109 <= nums[i] <= 109
-109 <= target <= 109
4sum problem leetcode Solution
The Skeleton Code given in Leetcode is

class Solution(object):
    def fourSum(self, nums, target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: List[List[int]]
        """
Firstly, Sort the given array of integers. Create a variable result that will store the list containing values of output. Create another variable lookup, which will have keys as the addition of two numbers and values as a list having a position of two numbers when added and give the key.


 
class Solution(object):
    def fourSum(self, nums, target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: List[List[int]]
        """        
        nums, result, lookup = sorted(nums), [], collections.defaultdict(list)
        
Secondly, Run two loops one starting from the start of the integers array and one starting from the second element. Fill up the values in the lookup dictionary.


 
class Solution(object):
    def fourSum(self, nums, target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: List[List[int]]
        """        
        nums, result, lookup = sorted(nums), [], collections.defaultdict(list)
        for i in xrange(0, len(nums) - 1):
            for j in xrange(i + 1, len(nums)):
                is_duplicated = False
                for [x, y] in lookup[nums[i] + nums[j]]:
                    if nums[x] == nums[i]:
                        is_duplicated = True
                        break
                if not is_duplicated:
                    lookup[nums[i] + nums[j]].append([i, j])

        

 
Check for the other two values which will be added with the values in the lookup dictionary and must return the target value. Don’t forget about the constraints that, a < b < c < d.

Complete Solution:

To get the solution visit https://hecodesit.com/4sum-problem-leetcode-python-solutions/
SQL QUERY, can someone solve?
Tags: sql, database
Published: 2022-01-28 19:31:13

Tables
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dos9dk0sbye1kylpxco1.png)
Output
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5r336umf3zb02dna7ou.png)
  write a query that returns 1st,2nd and 3rd place finishers in each category in that order. The columns are category,student_id,name,college_name and score order by category,college_name asc.
ReactJs - passing state as props using an onClick event (help please)
Published: 2022-01-28 19:28:56

Hello everyone!  I am very new to Developing, I have been learning Java Script, CSS, and HTML for about a year.  The last three months I have pivoted to using ReactJs.  Would love some help figuring out an issue I have been facing the last few days.  
I am creating a simple battle type game.  At the moment I am having trouble passing along state and props with an onClick event. (Also I am only comfortable using class components unfortunately so any help would be greatly appreciated on that format)
Comment vérifier le solde de votre carte-cadeau Walmart
Published: 2022-01-28 19:16:22

Savoir comment vérifier le solde de votre carte-cadeau [Walmart](https://www.walmart.com/) vous aidera à échanger ces fonds ou à les transformer en espèces.

Voici un guide étape par étape sur la façon de vérifier le solde de votre carte-cadeau Walmart. Mais d'abord, il est important de savoir comment fonctionnent les cartes-cadeaux Walmart.

[Comment fonctionnent les cartes-cadeaux Walmart](https://lafrtech.com/comment-verifier-le-solde-de-la-carte-cadeau-walmart-en-ligne/)

Les cartes-cadeaux [Walmart](https://www.walmart.com/) sont disponibles sous forme de cartes standard ou numériques. Vous pouvez les utiliser :

En ligne dans les magasins Walmart et Sam's Club
Dans les magasins Walmart et Sam's Club aux États-Unis et à Porto Rico
Dans les stations-service Murphy américaines approuvées
Façons de vérifier le solde de votre carte-cadeau Walmart
Connaître votre solde est la première étape vers l'encaissement de votre carte-cadeau Walmart. Walmart vous permet de vérifier votre solde de trois façons :

En ligne
En personne
Utilisation de votre téléphone
Comment vérifier le solde de votre carte-cadeau Walmart en ligne
Pour vérifier le solde de votre carte-cadeau en ligne :

Visitez la page de solde des cartes-cadeaux de Walmart.
Vous devrez entrer les 16 chiffres de votre numéro de carte-cadeau suivis du numéro d'identification personnel à quatre chiffres tel qu'indiqué. Si vous avez une carte-cadeau électronique, vous trouverez votre code PIN dans l'e-mail de confirmation.
Cliquez sur l'onglet "Obtenir le solde de la carte" et passez à la suivante.
Cliquez sur le bouton "Soumettre" et les détails du solde de votre carte s'afficheront.
Faites travailler votre argent pour vous

Comment vérifier le solde de votre carte-cadeau dans les magasins Walmart
Une autre façon de vérifier le solde de votre carte-cadeau Walmart consiste à visiter votre magasin local.

Pour consulter votre solde en magasin :

Trouvez votre magasin le plus proche à l'aide de l'outil de recherche de magasins Walmart. Vous devrez entrer le code postal ou entrer le nom dans la recherche avant d'appuyer sur le bouton "Rechercher".
Consultez les résultats de la recherche de magasins et choisissez le magasin le plus proche.
Apportez votre carte au magasin et demandez à un représentant du service à la clientèle de vérifier le solde.
Un employé vous dira combien il y a sur votre carte.
Comment vérifier le solde de votre carte-cadeau Walmart avec le service client à l'aide de votre téléphone
Vous pouvez également vérifier le solde de votre carte-cadeau par téléphone.

Pour vérifier le solde de votre carte-cadeau Walmart avec votre téléphone :

Composez le 1-888-537-5503 et vous serez dirigé vers le service à la clientèle de Walmart.
Faites attention au support client pour obtenir des instructions.
Choisissez une extension de ligne d'assistance pour le solde de la carte.
Entrez votre numéro de carte-cadeau et attendez.
Un représentant du service à la clientèle vous informera du solde de votre carte-cadeau Walmart.
On Being a Software Engineer
Tags: dotnet, javascript, csharp, beginners
Published: 2022-01-28 18:54:11

Do you ever feel like you made the wrong decision being a software engineer? Things are not working out and, you've been on the same bug for hours if not days, and you have no idea why it is not working. You're even thinking, things could not get worse than this. Did I make the right decision to choose this career path? 

As a software engineer, I can confidently say that that is where I am. It feels like I am walking one step forward and taking two steps backward. It's hard not to feel overwhelmed and think maybe my skills are overrated and I might not deliver as expected. 

With all the new things happening every day, it is hard not to get confused. It is an ever-changing tech industry and, we have to keep up with it. I was to learn python yesterday because of the hype in data science and machine learning. Today it seems to be solidity because of the web3 hype. What happens next after I have masted the new thing? 

That seems to be the trend, and still, I have chosen to do it probably for the rest of my life. They say, "choose your poison and let it kill you," and this is not the only poison I have chosen. I also choose to be ignorant of the outside noise - mark my word, not "ignorant" but "choose to be ignorant."

You must be wondering, why do I choose to be ignorant? If you've read "[The Subtle art of not giving an F](https://markmanson.net/books/subtle-art)" by Mark Manson. He talks about the paradox of choice - or, what were the exact words he used. He argues that it is hard to make decisions when presented with many options. It is easy to decide whether live in Nairobi or Mombasa than where to live from 10 different places in Kenya. No matter the decision you make, you will always feel short-changed. You will always feel you missed out on something.

When you decide with few choices, you will always feel at peace that you made the right decision. And that is why I choose ignorance, that unless necessary that I act, I will always ignore whatever is happening in this tech space. And that is why I am a [C#](https://dotnet.microsoft.com/en-us/) developer because it is the best programming language. 

It is something that I decided back in 2017 that I am at peace. It made more sense to focus on one thing than be half pregnant in 2 or more languages. C# is a language that Microsoft puts a lot of effort and resources into making better. It is a language I am open-minded to the changes made into it. A language I strive to be better at, a tool I want to perfect using, and when the right time calls, unload all its potential to solve a given problem.
Implementing SAGA with Spring and Axon
Tags: java, microservices, axon, saga
Published: 2022-01-28 18:46:35


![Saga Architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/roh0d6lxda0chk4upnap.jpeg)

### Project description

🚀 This project aims to create an application with microservices architecture by applying the Saga **Orchestration** pattern with **Axon and Spring** for all development. **Dockerfile** files are available for virtualization of microservices and within each service there is a deploy folder for running services in a **Kubernetes cluster**.

[Here is the complete code of the project](https://github.com/lucasnscr/Saga)

## Installation and  Technologies##

The following technologies were used to carry out the project and it is necessary to install some items:
- Docker
- Java 11
- Maven
- Kubernetes
- Spring
- Axon

### **Saga**

Saga is an old pattern developed in **1987** as a conceptual alternative for long-running database transactions in SQL databases. But a modern variation of this pattern works amazingly for the **distributed transaction** as well. Saga pattern is a **local transaction sequence** where each transaction updates data in the Data Store within a single Microservice and publishes an **Event or Message**. The first transaction in a saga is initiated by an external request (Event or Action). Once the local transaction is complete (data is stored in Data Store, and message or event is published), the published message/event triggers the next local transaction in the Saga.

### **Choreography or Orchestration**
**Choreography**: Decentralised co-ordinations where each Microservice produces and listen to other Microservice’s events/messages and decides if an action should be taken or not.

**Orchestration**: Centralised co-ordinations where an Orchestrator tells the participating Microservices which local transaction needs to be executed.
Pros

### **Pros**
- Provide consistency via transactions in a highly scalable or loosely coupled, event-driven Microservice Architecture.
- Provide consistency via transactions in Microservice Architecture where NoSQL databases without 2PC support are used.

### **Cons**

- Need to handle transient failures and should provide idempotency.
- Hard to debug, and the complexity grows as the number of Microservices increase.

### **Situations to use SAGA**

- In highly scalable, loosely coupled Microservice Architecture where event sourcing is used.
- In systems where distributed NoSQL databases are used.

### **Situations not to use SAGA**

- Lowly scalable transactional systems with SQL Databases.
- In systems where cyclic dependency exists among services.


Here we finish a Project implementing Saga(Orchestration) with Axon.
How To Create A New Go Language Project
Tags: go, programming, beginners, howto
Published: 2022-01-28 18:25:50

Before creating your first Go language project, make sure that you have installed the Go language in your system. Open a new terminal window and run the following command.

```
go version
```

It should print the Go language version that you have installed in your system or otherwise [install the Go language](https://devtonight.com/posts/how-to-install-and-setup-go-language-on-ubuntu-complete-guide?utm_source=dev&utm_medium=questions&utm_campaign=how-to-create-a-new-go-language-project) before proceeding. If you are using VSCode for code editing, make sure to install and activate the [VSCode Go extension](https://marketplace.visualstudio.com/items?itemName=golang.Go).

## Create A New Go Language Project

Usually, Go language projects can be created either from scratch by yourself or start with a project which is already existing in a repository somewhere like Github. First, you will be able to learn how to create a Go project from scratch and then from a sample project existing in a repository.

### Start A Go Language Project From Scratch

First, create a new directory for the Go project and go into the directory created.

```
mkdir hello-world

cd hello-world
```

Create the project module with the `go mod init` command. We need to provide a module path for the `go mod init` command. Usually, it is the URL where you publish your project. For example, if you are going to host your code in github.com/devtonighthq/hello-world, you can run the `go mod init` command like below.

```
go mod init github.com/username/hello-world
```

It will create a file called `go.mod`. Initially, the `go.mod` file will contain the information about the Go module path and the Go language version. When you add more dependencies to the project, they will be mentioned in this file.

Create the `main.go` file and add the following code to it.

```
package main

import "fmt"

func main() {
    fmt.PrintLn("Hello world!");
}
```

### Start A Go Language Project From A Repository

As explained earlier, you can create a Go language project by using an existing Go language project. First, download it or clone it if it is a Git repository like this.

```
git clone https://github.com/username/go-repo.git
```

Go into the project directory and run the `go mod download` command to download the necessary dependencies of the project. We can use the optional `-x` flag to print the progress.

```
go mod download -x
```

## Run The Go Application

This command will run the Go application.

```
go run main.go
```

## Build The Go Application

This command will create a compiled executable file of the Go application.

```
go build
```

Run the compiled executable file created in the previous step like this.

```
./executable-file 
```

Feel free to visit [devtonight.com](https://devtonight.com/tags/golang?utm_source=dev&utm_medium=questions&utm_campaign=how-to-create-a-new-go-language-project) for more related content.
Ngen doesnt't work on .net 6
Published: 2022-01-28 18:40:13

When I try to use ngen on a executable compiled with .net6 i get following error:

Microsoft (R) CLR Native Image Generator - Version 4.8.4320.0
Copyright (c) Microsoft Corporation. All rights reserved.
Uninstalling assembly C:\Users\User\Desktop\dotnet1.exe because of an error during compilation: Failed to load the runtime. (Exception from HRESULT: 0x80131700).
Failed to load the runtime. (Exception from HRESULT: 0x80131700)

On the other hand, a executable compiled with csc works perfect with ngen. How to solve this, if not possible what are the alternatives to ngen?
Tutorial: How to Launch JavaScript Chat and WebRTC Video conferencing samples
Tags: javascript, sdk, chat, webrtc
Published: 2022-01-28 18:23:43

---
title: Tutorial: How to Launch JavaScript Chat and WebRTC Video conferencing samples
published: true
description: 
tags: JavaScript, SDK, Chat, WebRTC 
//cover_image: https://direct_url_to_image.jpg
---
![Quickblox JavaScript Code Samples](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0lpt02oxv00syc9kteo.png)

See the [latest tutorial] (https://quickblox.com/blog/how-to-launch-javascript-chat-and-webrtc-video-conferencing-samples/)  published by QuickBlox that shows you how to launch our free JavaScript code samples for Chat and WebRTC Video Conferencing.

Have experience building chat with a JavaScript SDK? Tell us about it in the comments below.
How to Simulate a DockerHub Outage to Test Image Caching
Tags: devops, docker, aws, programming
Published: 2022-01-28 18:21:40

https://shipyard.build/blog/how-to-simulate-a-dockerhub-outage/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i8wt7k9sdqjfvole5spc.png)
X-Earth | New Augmented Reality App
Tags: app, augmentedreality, testing, startup
Published: 2022-01-28 18:16:41

Hello Dev Community,

There's a new app you need to check out. It's **X-Earth**, and AR app that allows you to explore cities in real-time and learn about the urban environment through the lenses of your phone.

[Learn more here.](https://www.xphera.earth/x-earth)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bmt412eqsca71pr7lci6.png)
Rails Generators
Published: 2022-01-28 18:12:59

We are finishing up our Rails curriculum at Flatiron School this week and I wanted to make a post about different generators Rails offers us. Generator commands take simple tasks like creating boilerplate code for your backend project and produce multiple template files almost immediately. I'd like to go over the differences of a few that I've used on every project.

To start, you can see a list of available generators with the simple command. Note: you can shorten these commands by typing `rails g` instead of `rails generate`.

`rails generate`

![console output from rails generate](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p54ew5jcftad4k8fp0z2.png)

Here are a few that I have been using the most. 
 
**Create a Migration file**

`rails generate migration Table_name column_1 column_2:boolean column_3:integer`

With this command you can name your table and optionally input all your column names with data types and get that out of the way with 1 simple terminal command! Any column name not given a data type will default to string.

**Create a Model and Migration file**

`rails generate model Table_name column_1 column_2:boolean column_3:integer`

This command will create both a migration and a model file.

**Create a Controller file**

`rails generate controller Controller_name`

This command will create a controller file for your model.

**Create a Resource file**

`rails generate model Table_name column_1 column_2:boolean column_3:integer`

This is a great generator that does a lot of work for you with one simple command. Thanks Rails! This produces a **migration**, a **model**, a **controller**, a **resources** method for all of the restful routing for your model, **views** for the model, a **serializer**, and some test files. Wow all that with one simple command.

**Remove the files**

`rails d resource Table_name`

If you made a typo or a table that you don't want anymore you can easily remove all the files created with your generator with this command to make sure everything is cleaned up nicely.
IIFE - Immediately invoked function expression
Tags: programming, javascript, beginners, react
Published: 2022-01-28 17:57:44


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sz3kkjf29kibu843n19p.png)In javascript, we can call function Immediately like the below code. we know every function needs to call after determine. but in this case, we can call the function togetherly.

```javascript
(function () {
    console.log('hello')
})();

// example 2

let x = (function(){
  return "my";
})();
console.log(x)
```
Remember Expression means its produce value and it will be inside first brackets.
Sometimes we need a local clouser environment because we know if we use multiple variables with the same name its have many possibilities for conflict with each variable. So if we are using the same name variable within a function expression it has no chance to replace the value or some things. Because the IIFE function creates a local clouser where the variable data is saved then we can use it anywhere.