teleren/devto huggingface dataset:
Content & Tooling Team Status Update
Tags: puppet, community
Published: 2023-04-07 15:01:09

---
title: Content & Tooling Team Status Update
published: true
date: 2023-04-07 00:00:00 UTC
tags: puppet, community
canonical_url: https://puppetlabs.github.io/content-and-tooling-team/blog/updates/2023-04-07-status-update/
---

## Happy Easter!!

Hey folks! Easter is finally here and a fair lot of us are going on some well-deserved holidays. Hoping everyone can spend some time with their family during this vacation. While you're at it, read about [Puppet's favorite Easter egg](https://twitter.com/puppetize/status/1644353196813430785).

## Updated workflows

This week we have completed our work updating our GitHub Actions workflows. This piece of work has been one of our focus points over the past few weeks as we invested resources into improving our infrastructure. As part of this work, we have standardised our use of workflows into a single shared origin while updating syntax to avoid future problems arising from deprecation.

## Major releases coming

Some big releases are coming lately as a result of our Puppet 8 module preparation. This week we have released six modules and we are expecting to keep releasing several modules per week until (and after) Puppet 8 officially comes out.

## Community Contributions

We’d like to thank the following people in the Puppet Community for their contributions over this past week:

- [`puppetlabs-java#550`](https://github.com/puppetlabs/puppetlabs-java/pull/550): “Fix shell\_escape of unless command”, thanks to [traylenator](https://github.com/traylenator)
- [`puppetlabs-mysql#1552`](https://github.com/puppetlabs/puppetlabs-mysql/pull/1552): “move static data from params to server class”, thanks to [bastelfreak](https://github.com/bastelfreak)
- [`puppetlabs-mysql#1549`](https://github.com/puppetlabs/puppetlabs-mysql/pull/1549): “fixtures.yml: Delete legacy symlink”, thanks to [bastelfreak](https://github.com/bastelfreak)
- [`pdk-templates#507`](https://github.com/puppetlabs/pdk-templates/pull/507): “Remove puppet-blacksmith requirement”, thanks to [MartyEwings](https://github.com/MartyEwings)
- [`puppet-syntax#142`](https://github.com/voxpupuli/puppet-syntax/pull/142): “Drop Ruby 1.8 testcode”, thanks to [bastelfreak](https://github.com/bastelfreak)

## New Module / Gem Releases

The following modules were released this week:

- [`puppetlabs-firewall`](http://github.com/puppetlabs/puppetlabs-firewall) (`5.0.0`)

- [`puppetlabs-haproxy`](https://github.com/puppetlabs/puppetlabs-haproxy) (`7.0.0`)

- [`puppetlabs-motd`](https://github.com/puppetlabs/puppetlabs-motd) (`7.0.0`)

- [`puppetlabs-registry`](https://github.com/puppetlabs/puppetlabs-registry) (`5.0.0`)

- [`puppetlabs-accounts`](https://github.com/puppetlabs/puppetlabs-accounts) (`8.0.0`)

- [`puppetlabs-exec`](https://github.com/puppetlabs/puppetlabs-exec) (`3.0.0`)
The Future of Node.js in Internet of Things (IoT) Development
Tags: webdev, javascript, node, programming
Published: 2023-04-07 09:30:03

Node.js has been one of the most popular platforms for server-side programming since its inception in 2009. However, its applications are no longer limited to server-side development. The Internet of Things (IoT) industry has recognized the potential of Node.js and is increasingly adopting it for IoT development. In this article, we will discuss the future of Node.js in IoT development and why it is a game-changer.

IoT devices are becoming more common, and their popularity is growing day by day. From smart home devices to industrial sensors, IoT devices are changing the way we interact with technology. However, building IoT solutions is not an easy task. Developers face several challenges in building scalable, secure, and reliable IoT applications. Node.js, with its asynchronous, event-driven architecture, is a perfect fit for building IoT applications. Here are some reasons why Node.js is the future of IoT development.

- **Scalability**: Node.js is built on the V8 JavaScript engine, which is known for its performance and scalability. Node.js provides a non-blocking I/O model, which allows it to handle a large number of connections concurrently. This makes Node.js an ideal platform for building IoT applications that need to handle large amounts of data.

- **Lightweight**: IoT devices have limited resources, such as memory and processing power. Node.js is lightweight and can run on devices with limited resources. This makes it an excellent choice for building IoT applications that require low memory and CPU usage.

- **Easy to learn**: Node.js is based on JavaScript, which is one of the most popular programming languages in the world. Developers who are familiar with JavaScript can quickly learn Node.js and start building IoT applications.

- **Community support**: Node.js has a large and active community that provides support, updates, and libraries for building IoT applications. This makes it easy for developers to find solutions to their problems and build applications quickly.

- **Security**: Security is a critical concern in IoT development. Node.js has built-in security features, such as the ability to sandbox applications, which makes it a secure platform for building IoT applications.

The future of IoT development lies in the ability to build scalable, secure, and reliable applications quickly. Node.js is an ideal platform for achieving this goal. With its scalability, lightweight nature, ease of learning, community support, and security features, Node.js is poised to become the platform of choice for IoT development.

In conclusion, Node.js is the future of IoT development. Its scalability, lightweight nature, ease of learning, community support, and security features make it an ideal platform for building IoT applications. As the IoT industry continues to grow, Node.js will play a significant role in shaping the future of IoT development.

Thanks for reading...
**Happy Coding!**
WHY USE HTML IN A WEBSITES ?
Tags: webdev, javascript, css, html
Published: 2023-04-07 09:13:05

HTML (Hypertext Markup Language) is the standard markup language used to create and structure content on the web. It provides a way to describe the structure and presentation of web pages, including text, images, links, and other media.

Structure: HTML provides a way to structure web content into logical sections, such as headings, paragraphs, lists, and tables. This makes it easier for search engines to index and understand the content of the page.

Accessibility: HTML provides the foundation for creating accessible websites that can be used by people with disabilities. By using semantic HTML, developers can ensure that the content is properly labeled and organized, making it easier for screen readers and other assistive technologies to interpret the page.

Adjustment: HTML provides a standard set of elements and attributes for creating web pages. This ensures that pages are consistent across different browsers and devices, and that they can be easily maintained and updated over time.

SEO: HTML provides the structure and metadata that search engines use to index web pages. By using semantic HTML and optimizing the page title, description, and other metadata, developers can improve the visibility of their site in search engine results.

Co-ordination: HTML can be integrated with other web technologies, such as that CSS for styling and JavaScript for interactivity. This allows developers to create rich, dynamic web applications that can more engaging user experience.
Understanding Zero Knowledge Proof in Blockchain
Tags: blockchain, cryptocurrency, privacy, security
Published: 2023-04-07 08:23:34

Zero Knowledge Proof is a cryptographic method that allows one party to prove to another party that a statement is true without revealing any information beyond the validity of the statement itself. In the world of blockchain, this technology can enhance privacy, security and scalability. Implementing Zero Knowledge Proof can significantly improve the efficiency of blockchain transactions, while maintaining a high level of security.
Concurrent INSERT and DELETE in the Same Table
Tags: opengauss
Published: 2023-04-07 08:18:21

Transaction T1:

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

Transaction T2:

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

Scenario 1:

T1 is started but not committed. At this time, T2 is started. After **INSERT** of T1 is complete, **DELETE** of T2 is performed. In this case, **DELETE 0** is displayed, because T1 is not committed and T2 cannot see the data inserted by T1.

Scenario 2:

**READ COMMITTED** level

T1 is started but not committed. At this time, T2 is started. After **INSERT** of T1 is complete, T1 is committed and **DELETE** of T2 is executed. In this case, **DELETE 1** is displayed, because T2 can see the data inserted by T1.

**REPEATABLE READ** level

T1 is started but not committed. At this time, T2 is started. After **INSERT** of T1 is complete, T1 is committed and **DELETE** of T2 is executed. In this case, **DELETE 0** is displayed, because the data obtained in queries is consistent in a transaction.
Potential Deadlocks During Concurrent Write
Tags: opengauss
Published: 2023-04-07 08:14:19

Whenever transactions involve updates of more than one table, there is always the possibility that concurrently running transactions become deadlocked when they both try to write to the same set of tables. A transaction releases all of its locks at once when it either commits or rolls back; it does not relinquish locks one at a time. For example, transactions T1 and T2 start at roughly the same time.

**·** If T1 starts writing to table A and T2 starts writing to table B, both transactions can proceed without conflict. However, if T1 finishes writing to table A and needs to start writing to the same rows as T2 does in table B, it will not be able to proceed because T2 still holds the lock on B. Conversely, if T2 finishes writing to table B and needs to start writing to the same rows as T1 does in table A, it will not be able to proceed either because T1 still holds the lock on A. In this case, a deadlock occurs. If T1 is committed and releases the lock within the lock timeout duration, subsequent update can proceed. If a lock times out, an error is reported and the corresponding transaction exits.
**·** If T1 updates rows 1 to 5 and T2 updates rows 6 to 10 in the same table, the two transactions do not conflict. However, if T1 finishes the update and proceeds to update rows 6 to 10, and T2 proceeds to update rows 1 to 5, neither of them can continue. If either of the transactions is committed and releases the lock within the lock timeout duration, subsequent update can proceed. If a lock times out, an error is reported and the corresponding transaction exits.
Write and Read/Write Operations
Tags: opengauss
Published: 2023-04-07 08:13:09

Statements for write-only and read/write operations are as follows:

**·** INSERT, used to insert one or more rows of data into a table
**·** UPDATE, used to modify existing data in a table
**·** DELETE, used to delete existing data from a table
**·** COPY, used to import data
INSERT and COPY are write-only operations. Only one of them can be performed at a time. If INSERT or COPY of transaction T1 locks a table, INSERT or COPY of transaction T2 needs to wait until T1 unlocks the table.

UPDATE and DELETE operations are read/write operations. They need to query for the target rows before modifying data. Concurrent transactions cannot see changes made by each other, and UPDATE and DELETE operations read snapshots of data committed before their transactions start. Write operations use row-level locks. If T2 starts after T1 and is to update the same row as T1 does, T2 waits for T1 to finish update. If T1 is not complete within the specified timeout duration, T2 will time out. If T1 and T2 update different rows in a table, they can be concurrently executed.
Transaction Isolation
Tags: opengauss
Published: 2023-04-07 08:06:25

openGauss manages transactions based on MVCC and two-phase locks, avoiding conflicts between read and write operations. SELECT is a read-only operation, whereas UPDATE and DELETE are read/write operations.

**·** There is no conflict between read/write and read-only operations, or between read/write operations. Each concurrent transaction creates a snapshot when it starts. Concurrent transactions cannot detect updates made by each other.

**·** At the READ COMMITTED level, if transaction T1 is committed, transaction T2 can see changes made by T1.
**·** At the REPEATABLE READ level, if T2 starts before T1 is committed, T2 will not see changes made by T1 even after T1 is committed. The query results in a transaction are consistent and unaffected by other transactions.

**·** Read/Write operations use row-level locks. Different transactions can concurrently update the same table but not the same row. A row update transaction will start only after the previous one is committed.

**·** **READ COMMITTED**: At this level, a transaction can access only committed data. This is the default level.
**·** **REPEATABLE READ**: Only data committed before transaction start is read. Uncommitted data or data committed in other concurrent transactions cannot be read.
Find your conference: calendar for developers
Tags: cpp, beginners, webdev, conferences
Published: 2023-04-07 07:44:00

Finding a conference to your liking is a challenge. Many people are probably familiar with the situation: rummaging through a bunch of websites, stacking on the search engines and thematic communities. You have to bookmark a bunch of sources where announcements of events are published randomly. One website only posts JS conferences, while another only posts about Android development meetups. It's inconvenient. Therefore, the PVS-Studio team launched an event aggregator for developers. You can find it on our website. 

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

Now all IT events are collected in one place. You no longer have to tediously search for a conference where you want to make a presentation or just be a participant. 

[Welcome: Events for developers!](https://pvs-studio.com/en/blog/events/)

The events are sorted by subject, country, and the format. The aggregator will show you a catalog of all C++ conferences or Java meetings in Germany in a couple of clicks. You don't have to scroll through a long overall list. 

The card of each event contains information about the date, the venue, the format, and the event organizer. There are also tags that indicate the topic of the conference. All conferences are divided by the programming language and industry. Events on information security, mobile development, gamedev, and other topics have their own categories.

The aggregator has now collected around 300 events. Each conference is checked before getting into the list. Only the most useful events reach the user. Once a week, the team searches for the newest events and adds them to the catalog. You can suggest your conference through the feedback form.

In addition to large conferences known around the world, the aggregator can show small meetups. This is one of the key features of our service — we want to promote small communities of developers from different countries who might find it difficult to find an audience without third-party support. When you attend them, it's easy to meet really passionate professionals: these guys are boosting the IT industry with their enthusiasm. 

The service operates without advertising: PVS-Studio doesn't get paid for publishing conferences and only includes events that are considered important. 

The aggregator contains events for many countries, but the focus is on English-speaking conferences. We believe that developers from all over the world will use this service.

The service is brand new — the team shared it to the public in March 2023. It would be cool if you could share your feedback :)
React fetch data from API and display in a table
Tags: react
Published: 2023-04-07 07:24:53

We will make use of [jsonplaceholder](https://jsonplaceholder.typicode.com/) for our APIs.

## Project setup

Create a react app using the following command:

```
npx create-react-app react-fetch-data-table
```

Add the following styles in `index.css`:

```css
body {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
```

## Calling the API

We will use the browser fetch API inside the [useEffect hook](https://www.codingdeft.com/posts/react-useeffect-hook/) to call the API to fetch data.

```jsx
import { useEffect, useState } from "react"

function App() {
  const [users, setUsers] = useState([])
  const [loading, setLoading] = useState(false)
  useEffect(() => {
    setLoading(true)
    fetch("https://jsonplaceholder.typicode.com/users")
      .then(response => response.json())
      .then(json => setUsers(json))
      .finally(() => {
        setLoading(false)
      })
  }, [])

  return <div className="App"></div>
}

export default App
```

Here we are calling the API and setting the response to the `users` state.
We also have a state named `loading` to display a loading text when the data is being fetched.

## Displaying the data

In the code below, we are [looping the users' array using map](https://www.codingdeft.com/posts/react-for-loop/) and displaying the user details in a table

```jsx
import { useEffect, useState } from "react"

function App() {
  const [users, setUsers] = useState([])
  const [loading, setLoading] = useState(false)
  useEffect(() => {
    setLoading(true)
    fetch("https://jsonplaceholder.typicode.com/users")
      .then(response => response.json())
      .then(json => setUsers(json))
      .finally(() => {
        setLoading(false)
      })
  }, [])

  return (
    <div className="App">
      {loading ? (
        <div>Loading...</div>
      ) : (
        <>
          <h1>Users</h1>
          <table border={1}>
            <tr>
              <th>Name</th>
              <th>Email</th>
              <th>Phone</th>
            </tr>
            {users.map(user => (
              <tr key={user.id}>
                <td>{user.name}</td>
                <td>{user.email}</td>
                <td>{user.phone}</td>
              </tr>
            ))}
          </table>
        </>
      )}
    </div>
  )
}

export default App
```

Now if you run the app, you will see the data being displayed in a table:

![users data displayed in a table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/viug7lt8rf5csvgb5pi5.png)

## Source code and Demo

You can view the complete [source code here](https://github.com/collegewap/react-fetch-data-table) and a [demo here](https://react-fetch-data-table.vercel.app/).
Fix: Cannot set headers after they are sent to the client
Tags: node
Published: 2023-04-07 07:22:42

If you are new to Node.js and express, you might have come across the following error:

```
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
```

In this article, we will discuss the possible causes of the error and how to fix them.

{% embed https://www.youtube.com/watch?v=9zpRfvu7Z4s %}


Consider the following code:

```js
app.get("/api/orders/:orderId", function (req, res) {
  if (!req.params.orderId.match(/[0-9]+/)) {
    res.status(400).send({
      error: "Order id is invalid",
    })
  }

  // some other code..

  res.send({
    // order details
  })
})
```

At first look, the code looks perfectly fine. But when we run the code by passing a string in the place of the orderId (`/api/orders/abcd`), you will get the error `Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client`.

The above error is occurring because when the order id is not a number, we are calling `res.send()` twice. Though `res.send()` sends the response back to the client, the code execution doesn't stop there. It continues with the execution of the remaining code and tries to return the response again to the client, hence the error.

We can fix this either by wrapping the rest of the code in an else block or adding a return at the end of the error handling:

```js
app.get("/api/orders/:orderId", function (req, res) {
  if (!req.params.orderId.match(/[0-9]+/)) {
    res.status(400).send({
      error: "Order id is invalid",
    })
  } else {
    res.send({
      // order details
    })
  }
})
```

OR

```js
app.get("/api/orders/:orderId", function (req, res) {
  if (!req.params.orderId.match(/[0-9]+/)) {
    res.status(400).send({
      error: "Order id is invalid",
    })
    return
  }
  res.send({
    // order details
  })
})
```

Another scenario where this error could occur is while you make a `res.send()` call after a promise is resolved.

```js
async function stall(stallTime = 3000) {
  await new Promise(resolve => setTimeout(resolve, stallTime))
}

app.get("/api/invoice/:invoiceId", function (req, res) {
  stall().then(() => {
    res.send({
      // invoice details
    })
  })

  // Some other code
  res.send({
    //some other data
  })
})
```

The fix for the above code is to carefully add conditions and ensure that `res.send()` is called only once per each scenario.
How to remove node_modules?
Tags: node, npm
Published: 2023-04-07 07:20:51

Have you ever got weird errors from npm and were suggested to delete node_modules directory and run `npm i`?
We will see different ways in which we can delete node_modules from your project.

{% embed https://youtu.be/64mgyG633n0 %}

## Deleting a single node_modules folder

You can delete the node_modules folder inside a single project by navigating to that project in the command prompt and
running the following command (use Powershell or Git Bash if you are using windows):

```bash
rm -rf node_modules
```

You can use the npm package called rimraf to delete the node_modules directory:

```bash
npx rimraf node_modules

```

## Listing and deleting multiple node_modules folders

If you want to list all the projects with node_modules, then you can use the following command:

```bash
find . -name "node_modules" -type d -prune | xargs du -chs

```

To select node_modules one by one and delete them you can use the `npkill` npm package:

```bash
npx npkill

```

You can use the arrow keys to select which node_modules folder you want to delete and delete them.
IT Services for Banking & Financial Software Solutions
Tags: bankingitsolutions, itsolutions, appdevelopment, python
Published: 2023-04-07 07:19:56

IT services for banks have become more and more relevant, and the banking industry has taken notice of this. Banking clients expect easy-to-use [Banking software solutions](https://www.cdnsol.com/blog/how-to-make-banking-it-solutions/
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1zfnfbau3iofr7z5t2n.png)) to manage their banking services. User benefits aside, using a banking IT solutions app can create many opportunities for traditional banking companies.
Building an IT solution for the banking sector requires many technical skills, and it also demands years of experience. There are many things to consider, and mistakes can be costly, so make sure to find the right development partner. IT services for banks are a fundamental part of any successful strategy in the financial services business.
Doing VACUUM to a Table
Tags: opengauss
Published: 2023-04-07 07:18:21

If a large number of rows were updated or deleted during import, run **VACUUM FULL** before **ANALYZE**. A large number of UPDATE and DELETE operations generate huge disk page fragments, which reduces query efficiency. **VACUUM FULL** can restore disk page fragments and return them to the OS.

Run the **VACUUM FULL** statement.

Do **VACUUM FULL** to the **product_info** table.

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