teleren/devto huggingface dataset:
A estrutura básica para um README.md completo e eficaz para o seu projeto no GitHub
Tags: github, beginners, programming, tutorial
Published: 2023-04-06 07:03:13

> Um bom README.md é essencial para qualquer projeto em Python. Ele ajuda os usuários a entenderem o que o projeto faz, como executá-lo, como contribuir para o projeto e muito mais. Neste post, vamos ver como criar um README.md completo e eficaz para o seu projeto em Python.



### Como escrever cada seção


**Título**
O título deve ser claro e informativo. Ele deve descrever o que o projeto faz em poucas palavras.
Descrição

**Descrição**
A descrição deve ser mais detalhada do que o título. Ela deve explicar o que o projeto faz e como ele pode ser usado. Você também pode incluir exemplos de uso nesta seção.

**Pré-requisitos**
Nesta seção, você deve listar todas as dependências necessárias para executar o projeto. Você deve incluir o nome da biblioteca e a versão que o projeto requer.

**Instalação**
Nesta seção, você deve explicar como instalar o projeto. Você pode incluir o comando necessário para instalar as dependências ou fornecer um arquivo requirements.txt.

**Utilização**
Nesta seção, você deve explicar como usar o projeto. Você pode incluir exemplos de código ou referenciar arquivos de demonstração.

**Arquivos**
Nesta seção, você deve listar os arquivos do projeto. Isso inclui arquivos de código, arquivos de dados e quaisquer outros arquivos que sejam importantes para o projeto.

**Contribuições**
Nesta seção, você deve explicar como os usuários podem contribuir para o projeto. Você pode incluir informações sobre como criar pull requests, como reportar bugs ou como entrar em contato com o desenvolvedor.

**Licença**
Nesta seção, você deve explicar qual é a licença do projeto. É importante que os usuários saibam sob quais termos o projeto é distribuído.


**_Resumindo a Estrutura do README.md_**

- **Título:** O título deve ser claro e informativo sobre o que o projeto faz.
- **Descrição:** A descrição deve explicar o que o projeto faz e como ele pode ser usado.
- **Pré-requisitos:** Nesta seção, você deve listar as dependências necessárias para executar o projeto.
- **Instalação:** Nesta seção, você deve explicar como instalar o projeto.
- **Utilização:** Nesta seção, você deve explicar como usar o projeto.
- **Arquivos:** Nesta seção, você deve listar os arquivos do projeto.
- **Contribuições:** Nesta seção, você deve explicar como os usuários podem contribuir para o projeto.
- **Licença:** Nesta seção, você deve explicar qual é a licença do projeto.

### **Conclusão**
Criar um bom README.md é essencial para qualquer projeto em Python. Ele ajuda os usuários a entenderem o que o projeto faz, como executá-lo, como contribuir para o projeto e muito mais. Ao seguir as dicas apresentadas neste post, você pode criar um README.md completo e eficaz para o seu projeto.
Childhood Dreams vs. Tech Reality: How Did You End Up Here?
Tags: discuss, beginners, codenewbie
Published: 2023-04-06 07:00:00

They say that the things you loved as a kid can give you clues about what you'll love doing as an adult. Did you dream of being an astronaut, a veterinarian, the next Michael Jackson or Britney Spears (depending upon your birth year)? We want to hear how you ended up in the tech industry. Did you stumble into it by accident, or did you always know that tech was where you belonged? 

What childhood interests or hobbies led you to where you are today?

---

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more engaging, thought-provoking, and sometimes silly discussions just like this.
Add existing remote repositories to your git bash
Published: 2023-04-06 06:53:22

Firstly clone the repositories and then check all the branches using 

**1. Fetch all remote branches**

```
git fetch origin
```

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


This fetches all the remote branches from the repository. origin is the remote name you're targetting. So if you had an upstream remote name, you can call git fetch upstream.
**2. Check your branches ( -a means all ; remote + local))**
```
git branch -a
```

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


Then you can use your desired branch by creating one in your local system while copying all the content from remote branch.

**3. Pull changes to your remote branch**

```
git pull origin dev-bn
```

- it creates a new branch called dev-bn
- it pulls changes from origin/dev-bn to that branch

Here our target is to work with the dev-bn branch and thus doing this.


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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g7rlqhnp7n11vqwjffa7.png)
Now I can easily switch to my dev-bn branch which is connected to the remote dev-bn branch as well.
How do work PingTimeout/PingInterval ?
Published: 2023-04-06 06:49:39

I am using socket.io library in my project, I have read about session timeout can be control with properties as pingTimeout and pingInterval but when I use these it is not working, when I connect the device to server and I don't do anything the device is disconnecting something 3min. It is not taking custom pingTimeout and pingInterval
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8y1kskewykf2yegczadp.PNG)
What is java Classes and methods
Tags: java
Published: 2023-04-06 04:43:25

In Java, a class is a blueprint or a template that defines the properties and behaviors of an object. It provides a structure for creating objects, which are instances of the class. A class defines the attributes of an object, such as its data members, and the methods that can be performed on it.

A method is a block of code that performs a specific task. It is defined within a class and can be called by an object of that class. Methods are used to manipulate the data members of an object, as well as to perform other tasks such as input/output operations, calculations, and data processing. A part from it if you want to upgrade yourself and want to learn programming skills. Check in-depth and Upskill yourself Oracle certified Fundamentals concepts from [Java Course](https://www.edureka.co/java-j2ee-training-course).

**Here is an example of a Java class with methods:**
public class Person {
  // Data members
  private String name;
  private int age;
  
  // Constructor
  public Person(String name, int age) {
    this.name = name;
    this.age = age;
  }
  
  // Getter methods
  public String getName() {
    return name;
  }
  
  public int getAge() {
    return age;
  }
  
  // Setter methods
  public void setName(String name) {
    this.name = name;
  }
  
  public void setAge(int age) {
    this.age = age;
  }
  
  // Other methods
  public void printDetails() {
    System.out.println("Name: " + name);
    System.out.println("Age: " + age);
  }
  
  public void sayHello() {
    System.out.println("Hello, my name is " + name + ".");
  }
}
In this example, the Person class defines two data members, name and age, as well as several methods. The constructor is a special method that is called when an object of the class is created. It sets the initial values of the name and age data members.

The getter and setter methods are used to access and modify the values of the data members, respectively. The printDetails() method prints out the values of the name and age data members, while the sayHello() method prints out a greeting message using the name data member.

**To create an object of the Person class and call its methods, you can do the following:**

Person person1 = new Person("John", 25);
person1.printDetails(); // Output: Name: John, Age: 25
person1.sayHello(); // Output: Hello, my name is John.
person1.setAge(30);
person1.printDetails(); // Output: Name: John, Age: 30

In this example, an object of the Person class is created with the name person1. The printDetails() and sayHello() methods are called on the person1 object, and the setAge() method is used to modify the value of the age data member.
Say Goodbye to Frustrated Users with React-Network-Notifier! 🚀
Tags: react, javascript, frontend, nextjs
Published: 2023-04-06 05:54:39


![No Internet No Worries](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yv2ksfaje9d1aamswaiu.jpg)

Ever faced a situation where your users are staring at a blank screen when their internet connection is lost? **Well, say hello to React-Network-Notifier, a fun and easy-to-integrate React component that keeps your users informed (and entertained) about their connection status! 🎉**

React-Network-Notifier _displays a hilarious message alongside a quirky ASCII art image whenever users lose their internet connection_. Compatible with both React and Next.js, this package ensures that your users will stay engaged during those pesky moments of disconnection.

##Key Features:

- A breeze to use with React
- Plays well with both React and Next.js
- Customizable messages and images
- A set of default messages and ASCII art
- Supports Server Side Rendering (SSR)
- Configure it to your heart's content with custom styles and properties
- Disappears like magic when the connection is back

##Getting Started:

To start having fun with React-Network-Notifier, install the package using npm or yarn:

```bash

npm install react-network-notifier
#or 
yarn add react-network-notifier
```

Next, import the NetworkNotifier component and add it to your application:

```javascript

import NetworkNotifier from 'react-network-notifier';

function App() {
  return (
    <div>
      <NetworkNotifier />
      {/* Your app content */}
    </div>
  );
}
```
##Customization:

Want to make React-Network-Notifier truly yours? Customize messages, images, and appearance with styles:

```javascript

import NetworkNotifier from 'react-network-notifier';

const customMessages = [
  "Whoops, the internet went on vacation!",
  "No connection, but we'll be right back!",
  // ...more messages
];

const customStyles = {
  background: 'linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%)',
  color: '#fff',
  // ...more styles
};

function App() {
  return (
    <div>
      <NetworkNotifier messages={customMessages} styles={customStyles} />
      {/* Your app content */}
    </div>
  );
}
```
##Conclusion:

React-Network-Notifier is the perfect solution to keep your users informed and entertained during unexpected internet outages. Its simple API and extensive customization options make it a must-have for any modern web application.

Why wait? Try it out, contribute, or reach out with any questions, suggestions, or feedback!

GitHub: https://github.com/J3rry320/react-network-notifier
How does Kubernetes scale resources for a Minecraft server on a cluster?
Tags: minecraft, beginners
Published: 2023-04-06 05:54:30

Kubernetes is a popular container orchestration tool that can be used to manage and scale Minecraft servers in a cluster. Here are the steps Kubernetes takes to scale resources for a Minecraft server on a cluster:

Define a Minecraft server deployment: In Kubernetes, you define a Minecraft server deployment as a set of container specifications and resource requirements. This deployment specifies the number of replicas (i.e., Minecraft server instances) to run, as well as the CPU and memory limits for each replica.

Monitor the server's resource usage: Kubernetes uses metrics to monitor the Minecraft server's resource usage, such as CPU and memory usage. This allows Kubernetes to determine when additional resources are needed to handle the server's workload.

Scale up the deployment: When the Minecraft server's resource usage exceeds a certain threshold, Kubernetes can automatically scale up the deployment by creating additional replicas of the Minecraft server. This ensures that the Minecraft server can handle the increased workload.

Load balance traffic: To ensure that all Minecraft server replicas receive an equal share of traffic, Kubernetes can load balance traffic between the replicas. This helps to prevent any one replica from becoming overloaded with requests.

Scale down the deployment: When the Minecraft server's resource usage decreases, Kubernetes can automatically scale down the deployment by removing replicas that are no longer needed. This helps to reduce resource usage and save costs.

Overall, Kubernetes provides a powerful platform for managing and scaling Minecraft servers in a cluster. By leveraging Kubernetes' automation and resource management capabilities, you can ensure that your Minecraft server is always available, responsive, and scalable.
Stored Procedures
Tags: opengauss
Published: 2023-04-04 01:36:53

A stored procedure is a set of SQL statements that can implement a specific function. You can repeatedly call the stored procedure to reduce the number of repeated SQL statements and improve work efficiency.

Syntax
Create a stored procedure.

""
CREATE PROCEDURE procedure_name
    [ ( {[ argname ] [ argmode ] argtype [ = expression ]}[,...]) ]
    { IS | AS } 
    BRGIN
      procedure_body
    END
/
Call a stored procedure.

""
CALL procedure_name ( param_expr );
Delete a stored procedure.

""
DROP PROCEDURE procedure_name ;
Parameter Description
procedure_name

Specifies the name of the stored procedure to be created.

argname

Specifies the parameter name.

argmode

Specifies the mode of a parameter. Value range: IN, OUT, INOUT, and VARIADIC. VARIADIC specifies parameters of array type. The default value is IN.

IN

Specifies an input parameter. The value of the parameter must be specified when the stored procedure is called. If the value of the parameter is changed in the stored procedure, the value cannot be returned.

OUT

Specifies an output parameter. The value can be changed in the stored procedure and can be returned.

INOUT

Specifies input and output parameters. The value can be specified when the stored procedure is called and can be changed and returned.

argtype

Specifies the data type of the parameter.

expression

Sets the default value.

IS, AS

Required for the syntax. One of them must be provided. They have the same function.

BRGIN, END

Required for the syntax.

procedure_body

Specifies the stored procedure content.

param_expr

Specifies the parameter list. Use commas (,) to separate parameters. Use := or => to separate parameter names and parameter values.

Examples
""
-- Create a table
openGauss=# CREATE TABLE graderecord  
(  
  number INTEGER,  
  name CHAR(20),  
  class CHAR(20),  
  grade INTEGER
);

-- Define a stored procedure.
openGauss=# CREATE PROCEDURE insert_data  (param1 INT = 0, param2 CHAR(20),param3 CHAR(20),param4 INT = 0 ) 
IS
 BEGIN 
 INSERT INTO graderecord VALUES(param1,param2,param3,param4);  
END;
/


-- Call the stored procedure.
openGauss=# CALL  insert_data(param1:=210101,param2:='Alan',param3:='21.01',param4:=92);

-- Delete the stored procedure.
openGauss=# DROP PROCEDURE insert_data;
Previous
Devographics API Update, April 2023
Published: 2023-04-06 05:37:29

---
title: Devographics API Update, April 2023
published: true
description: Introducing a couple new features
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-04-06 05:17 +0000
---

I've spent the last couple months working on a total rewrite of the API layer that powers the State of JavaScript, State of CSS, and State of GraphQL surveys. 

The core issue was that this API had initially been conceived for to handle the State of JavaScript data. Then, when we decided to branch out into CSS land, I bolted on additional types and fields to support that – and again when it came time to add the GraphQL survey. 

As you can imagine, the resulting mess was far from ideal. So with this rewrite, I wanted to throw out all the vast majority of our manually-defined GraphQL types and instead generate the entire API from [the same YAML files](https://github.com/Devographics/surveys/blob/main/state_of_js/js2022/questions.yml) that define the contents of each survey. 

### A better GraphQL structure

The result is a much cleaner API structure, as you can see in the [GraphiQL Explorer](https://graphiql.devographics.com/). It's literally the same structure as the survey results, which makes it a lot easier to explore our data! 

![GraphiQL Explorer showing a sample query for Astro data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nju5733z2pasfjkyusn9.png)

### All the filters!

A nice side-effect of everything in the API being dynamically generated is that you can now filter any question by any other question!

![Filtering a question](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57rkphg72ykz2x6wcu2g.png)

### A more useful Data Explorer

The same is true of the [Data Explorer](https://2022.stateofjs.com/en-US/explorer/). You can now compare any two questions, such as React vs Next.js use:

![React vs Next.js use](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2sjlzqarotm7oj7zctvk.png)

### Thanking our supporters

It would be impossible for me to just take two months to work full-time on such a big rewrite without the support of the companies sponsoring my work, and I want to especially thank the folks in the Google Chrome team, as well as [Nijibox](https://www.nijibox.jp/) here in Japan for believing in the project!

A big thanks as well to all the people who chose to sponsor a chart directly. It means a lot to know that the community itself also supports the surveys!

### Try it out!

You can try out the [new version of the State of JavaScript 2022 Survey Results](https://2022.stateofjs.com/) right now.

![Astro vs Company Size](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/io8s33mspekj01eqen2e.png)

It might not seem like much has changed, but try playing with the filters or the Data Explorer and you might find some interesting new insights – or more likely find some bugs, in which case do [leave an issue](https://github.com/Devographics/Monorepo/issues)!
Stack - DSA | Part 5 |
Tags: stack, algorithms, datastructure, programming
Published: 2023-04-06 05:37:18

In computer science, a stack is an abstract data type that represents a collection of elements with a _last-in-first-out_ (LIFO) access policy.

It is called a **"stack"** because it resembles a stack of plates or a stack of books, where you can only add or remove elements from the top of the stack. The element that was added last is the first one to be removed.

The two fundamental operations of a stack are **"push"** (which adds an element to the top of the stack) and **"pop"** (which removes the top element from the stack). Additionally, there are also **"peek"** operations, which allow you to examine the top element without removing it, and **"isEmpty"** operations, which check if the stack is empty.

Stacks are often used in computer programs for storing temporary data or for implementing algorithms that require a LIFO structure, such as expression evaluation, recursion, and undo mechanisms.

### Implementation of Stack
```cpp
#include <bits/stdc++.h>

using namespace std;

#define MAX 1000

class Stack {
	int top;

public:
	int a[MAX];

	Stack() { top = -1; }
	bool push(int x);
	int pop();
	int peek();
	bool isEmpty();
};

bool Stack::push(int x)
{
	if (top >= (MAX - 1)) {
		cout << "Stack Overflow";
		return false;
	}
	else {
		a[++top] = x;
		cout << x << " pushed into stack\n";
		return true;
	}
}

int Stack::pop()
{
	if (top < 0) {
		cout << "Stack Underflow";
		return 0;
	}
	else {
		int x = a[top--];
		return x;
	}
}
int Stack::peek()
{
	if (top < 0) {
		cout << "Stack is Empty";
		return 0;
	}
	else {
		int x = a[top];
		return x;
	}
}

bool Stack::isEmpty()
{
	return (top < 0);
}


int main()
{
	class Stack s;
	s.push(10);
	s.push(20);
	s.push(30);
	cout << s.pop() << " Popped from stack\n";
	
	
	cout << "Top element is : " << s.peek() << endl;
	
	
	cout <<"Elements present in stack : ";
	while(!s.isEmpty())
	{
		cout << s.peek() <<" ";
		s.pop();
	}

	return 0;
}
```
Remove All Default Installed games in Ubuntu by Single Command
Tags: ubuntu, ubuntugames, linuxgames, linux
Published: 2023-04-06 05:34:59

The default installation of popular Ubuntu operating systems include many games. For developers and diskspace conscious users these games are unessary.To remove all the games using a command line one-liner use the following. It will Work for Ubuntu 18, 20 & 22 versions.

`sudo apt purge thunderbird* -y && sudo apt-get remove rhythmbox -y && sudo apt purge aisleriot gnome-mahjongg gnome-mines gnome-sudoku -y && sudo apt-get remove remmina -y && sudo apt-get remove transmission-gtk -y && sudo apt-get autoremove -y && exit`
pulumi stack - error: getting selected stack: failed to decrypt
Published: 2023-04-06 03:48:38

If you do `pulumi stack` and get an error like this:

> error: getting selected stack: failed to decrypt: incorrect passphrase, please set PULUMI_CONFIG_PASSPHRASE to the correct passphrase or set PULUMI_CONFIG_PASSPHRASE_FILE to a file containing the passphrase

Check what value is being used for the passphrase, in powershell, `$env:PULUMI_CONFIG_PASSPHRASE`. 

Ultimately you simply need to ensure the passphrase is correct. The issue I had was it looked correct but the project I was working on at the time had a different passphrase to our other projects. Turns out the passphrase for this project was "", an empty string.

> Best practice suggestion - keep the passphrase consistent across all dev projects and stacks, then different for all prod stacks.

To change the password for a stack you can use [this](https://www.pulumi.com/docs/reference/cli/pulumi_stack_change-secrets-provider/): `pulumi stack change-secrets-provider passphrase`. Apply this to ALL stacks. Also do it for the PROD stack but you want to use a different passphrase for that stack.

Why make the passphrase consistent? When you start working with multiple Pulumi projects, when you change projects, you have to remember to log into the correct Pulumi backend, plus ensure you are logged into the correct Azure tenant and have the correct subscription selected. Having different passphrases is one more thing to trip up you and your developers and waste time. Some projects require more security, obviously in those cases you want to prefer being more secure vs being more convenient.
About PMP® Risk Management
Tags: education, onlinecourses, training, courses
Published: 2023-04-06 05:14:14

Risk is described by the **[Project Management Institute](https://youtu.be/zf7sNeEWHrY)** (PMI)® as "An uncertain event or condition that, if it occurs, has a positive or negative effect on one or more project objectives."  Use the Risk Management Process PMP, which includes the steps of Identify, Analyze, Prioritize, Assign, Plan, Monitor, Treat, and Report, to more effectively ensure that your project achieves all of its goals. There are Risk Management Tools and Techniques for each Risk Management Process. Determine your company's or client's risk tolerance as part of your risk management work because it affects the amount of work you should put into each risk management process.