teleren/devto huggingface dataset:
📝🤖💬 Bash AI: The Ultimate Command-Line Tool
Tags: productivity, automation, openai, gpt3
Published: 2023-04-16 06:42:02

Are you tired of typing out long, complicated bash commands? Do you wish there was a way to automate your workflow and make your life easier? Look no further than Bash AI! 🚀

Bash AI is a command-line tool that uses the power of OpenAI's GPT-3 to provide intelligent suggestions and automation for your bash commands. 🤖 Simply type `??` followed by your command, and Bash AI will analyze it and provide suggestions for how to complete or automate it.

For example, if you want to create a new file called `app.log`, just type:
```bash
?? create new file app.log
```
Bash AI will suggest the command `$ touch app.log`, and you can choose whether to run it in your terminal or not. 🤔

But before you can start using Bash AI, you need to set your OpenAI API key as an environment variable. Just export it like this:
```bash
export OPENAI_API_KEY=<your_openai_api_key>
```

And that's it! With Bash AI, you can streamline your workflow, save time, and make your life easier. Try it out today! 👍

{% embed https://www.npmjs.com/package/@markvachi/bash-ai %}
Arrays - DS hackerrank Solution in java
Tags: java, hackerrank, dsa, algorithms
Published: 2023-04-16 06:41:27

```
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.regex.*;
import java.util.stream.*;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList;

class Result {


    public static List<Integer> reverseArray(List<Integer> a) {
        List<Integer> res = new ArrayList<Integer>();
        for(int i=a.size()-1;i>=0;i--){
            res.add(a.get(i));
        }
        return res;
    }

}

public class Solution {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));

        int arrCount = Integer.parseInt(bufferedReader.readLine().trim());

        List<Integer> arr = Stream.of(bufferedReader.readLine().replaceAll("\\s+$", "").split(" "))
            .map(Integer::parseInt)
            .collect(toList());

        List<Integer> res = Result.reverseArray(arr);

        bufferedWriter.write(
            res.stream()
                .map(Object::toString)
                .collect(joining(" "))
            + "\n"
        );

        bufferedReader.close();
        bufferedWriter.close();
    }
}

```
Choosing the Right Indexing Strategy: Clustered vs Non-Clustered Indexes
Published: 2023-04-21 20:25:35

---
title: Choosing the Right Indexing Strategy: Clustered vs Non-Clustered Indexes
published: true
date: 2023-04-16 06:41:01 UTC
tags: 
canonical_url: https://harshmange.hashnode.dev/choosing-the-right-indexing-strategy-clustered-vs-non-clustered-indexes
---

When deciding whether to use a clustered or non-clustered index in a database, there are a few factors to consider:

1. Table size and data distribution: If the table is relatively small, a clustered index may not provide significant benefits, and a non-clustered index may be sufficient. On the other hand, if the table is very large, a clustered index can help improve query performance by reducing the number of disk reads required to retrieve data. Additionally, if the data in the table is uniformly distributed, a clustered index may be more beneficial than a non-clustered index.

2. Data modification frequency: Tables with frequent data modification operations such as inserts, updates, and deletes may benefit from a non-clustered index over a clustered index. This is because a clustered index requires reorganizing the data on disk, which can be time-consuming and resource-intensive. Non-clustered indexes, on the other hand, are generally quicker to create and update.

3. Query patterns: The type of queries that will be run against the table is also an important consideration. Queries that commonly use the same column(s) for filtering or sorting may benefit from a non-clustered index. Queries that frequently access all the columns in a table or require sorting by multiple columns may benefit from a clustered index.

4. Primary key or unique constraints: A table must have a clustered index if it has a primary key or unique constraint. In this case, the primary key or unique constraint is used to create the clustered index, and a non-clustered index can be created on other columns.

In summary, a clustered index is useful for large tables with uniform data distribution and queries that frequently access all columns or require sorting by multiple columns. A non-clustered index is useful for smaller tables with frequently modified data or queries that frequently filter or sort by specific columns. Ultimately, the decision to use a clustered or non-clustered index will depend on the specific characteristics of the table and the queries that will be run against it.
Basic difference between a Clustered Index and a Non-Clustered Index
Published: 2023-04-21 20:24:03

---
title: Basic difference between a Clustered Index and a Non-Clustered Index
published: true
date: 2023-04-16 06:37:53 UTC
tags: 
canonical_url: https://harshmange.hashnode.dev/basic-difference-between-a-clustered-index-and-a-non-clustered-index
---

In a database, an index is a data structure that allows for quick access to specific data within a table. Indexes can be categorized into two types: clustered and non-clustered indexes.

## Clustered Index

A clustered index determines the physical order of data in a table. This means that the data in the table is physically organized based on the values in the index. In other words, a clustered index reorders the data in the table itself to match the order of the index. A table can have only one clustered index, and it's generally created on the primary key of the table.

### Example

To create a clustered index in a database, you can use SQL commands. Here's an example of the SQL command to create a clustered index on a table named "example\_table" with a primary key column named "id":

```
CREATE CLUSTERED INDEX idx_example_table_id ON example_table (id);

```

In this example, "idx\_example\_table\_id" is the name of the clustered index that you are creating, and "id" is the name of the primary key column in the "example\_table" table. You can replace "example\_table" and "id" with the name of the table and primary key column you want to create the clustered index on.

## Non-Clustered Index

A non-clustered index creates a separate structure that contains the index data, rather than physically ordering the table data. The index data structure contains a copy of the indexed column(s) and a reference to the corresponding table data. This allows for faster data retrieval based on the indexed column(s) as the database engine can use the index to locate the table data more quickly. A table can have multiple non-clustered indexes.

### Example

To create a non-clustered index in a database, you can use SQL commands. Here's an example of the SQL command to create a non-clustered index on a table named "example\_table" with a column named "name":

```
CREATE INDEX idx_example_table_name ON example_table (name);

```

In this example, "idx\_example\_table\_name" is the name of the non-clustered index that you are creating, and "name" is the name of the column in the "example\_table" table. You can replace "example\_table" and "name" with the name of the table and column you want to create the non-clustered index on.

Also, keep in mind that creating too many indexes on a table can negatively impact the database's write performance as it can increase the time taken to insert and update data. Therefore, it's important to strike a balance between the number of indexes and their usefulness in improving query performance.

> [Clustered Index or Non-Clustered Index, What should you use? - Read more](https://harshmange.hashnode.dev/choosing-the-right-indexing-strategy-clustered-vs-non-clustered-indexes)
How To Implement MultiTenancy In Server-Side Blazor Using Database Per Tenant Strategy
Tags: blazor, multitenant, multitenancy, databasepertenantstrategy
Published: 2023-04-16 06:17:28

This Video Demonstrates How To Implement MultiTenancy In Server-Side Blazor Using Database Per Tenant Strategy. Source Code can be pulled from https://github.com/benjaminsqlserver/BlazorDatabasePerTenantStrategy
{% embed https://www.youtube.com/watch?v=gflYubkZNHg %}
Terrafrom Sketch Notes | Terraform Architecture| Part -1.1
Tags: beginners, terraform, devops, aws
Published: 2023-04-16 05:20:25

Terraform is an open-source infrastructure-as-code (IaC) platform that allows users to declaratively define, provide, and manage infrastructure resources.


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

There are several layers to examine when it comes to Terraform's architecture:

Configuration Layer: This is where the Terraform code is written. It defines the infrastructure resources that need to be created, updated, or deleted.

State Layer: This layer is responsible for storing the current state of the infrastructure. It tracks the resources that have been created, updated, or deleted, and stores this information in a state file.


Provider Layer: Providers are plugins that Terraform uses to interact with infrastructure resources. Each provider is responsible for a specific set of resources (e.g. AWS, Google Cloud, Azure, etc.).



Execution Layer: This layer is responsible for executing the Terraform code. It reads the configuration files, interacts with the providers to create/update/delete resources, and updates the state file

Terraform's architecture is modular and adaptable in general, allowing users to specify and manage infrastructure resources across numerous cloud providers and on-premises infrastructure.
Queue - DSA | Part 6 |
Tags: queue, datastructure, algorithms, programming
Published: 2023-04-16 05:04:01

A **queue** is a useful data structure in programming. It is similar to the ticket queue outside a cinema hall, where the first person entering the queue is the first person who gets the ticket.

Queue follows the First In First Out (FIFO) rule - the item that goes in first is the item that comes out first.


![Queue by Programmiz](https://cdn.programiz.com/sites/tutorial2program/files/queue.png)

In programming terms, putting items in the queue is called _enqueue_, and removing items from the queue is called _dequeue_.

### Basic Operations of Queue
A queue is an object (an abstract data structure - ADT) that allows the following operations:

* Enqueue: Add an element to the end of the queue
* Dequeue: Remove an element from the front of the queue
* IsEmpty: Check if the queue is empty
* IsFull: Check if the queue is full
* Peek: Get the value of the front of the queue without removing it

---
### Queue Implementations in C++
```cpp
#include <iostream>
#define SIZE 5

using namespace std;

class Queue {
   private:
  int items[SIZE], front, rear;

   public:
  Queue() {
    front = -1;
    rear = -1;
  }

  bool isFull() {
    if (front == 0 && rear == SIZE - 1) {
      return true;
    }
    return false;
  }

  bool isEmpty() {
    if (front == -1)
      return true;
    else
      return false;
  }

  void enQueue(int element) {
    if (isFull()) {
      cout << "Queue is full";
    } else {
      if (front == -1) front = 0;
      rear++;
      items[rear] = element;
      cout << endl
         << "Inserted " << element << endl;
    }
  }

  int deQueue() {
    int element;
    if (isEmpty()) {
      cout << "Queue is empty" << endl;
      return (-1);
    } else {
      element = items[front];
      if (front >= rear) {
        front = -1;
        rear = -1;
      } 
      else {
        front++;
      }
      cout << endl
         << "Deleted -> " << element << endl;
      return (element);
    }
  }

  void display() {
    int i;
    if (isEmpty()) {
      cout << endl
         << "Empty Queue" << endl;
    } else {
      cout << endl
         << "Front index-> " << front;
      cout << endl
         << "Items -> ";
      for (i = front; i <= rear; i++)
        cout << items[i] << "  ";
      cout << endl
         << "Rear index-> " << rear << endl;
    }
  }
};

int main() {
  Queue q;

  
  q.deQueue();

 
  q.enQueue(1);
  q.enQueue(2);
  q.enQueue(3);
  q.enQueue(4);
  q.enQueue(5);

  
  q.enQueue(6);

  q.display();

  
  q.deQueue();

 
  q.display();

  return 0;
}
```
Made a Disease prediction web app
Tags: beginners, python, machinelearning
Published: 2023-04-16 04:57:29

Made a Disease prediction app using streamlit and regression machine learning models




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zvde7omthnzy9nbw4w82.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gx5nzn5mx3vzrrjuur8u.png)
Crashing Code: The Hidden Dangers of Programmer Burnout and How to Avoid Them
Tags: programmer, burnout
Published: 2023-04-16 04:40:15

---
title: Crashing Code: The Hidden Dangers of Programmer Burnout and How to Avoid Them
published: true
description: 
tags: programmer, burnout
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53094rh14mk7x34aq4tz.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-04-16 04:12 +0000
---

In today's world, technology is rapidly advancing, and computer programmers are in high demand. Programmers are responsible for developing software and applications that power the modern world, and their work is critical for businesses, individuals, and society as a whole. However, working in the tech industry can be challenging, and many programmers experience burnout, which can have serious consequences.

Burnout is a state of physical, emotional, and mental exhaustion caused by prolonged periods of stress and pressure. When programmers experience burnout, they may lose their passion for their work, feel overwhelmed, and struggle to perform their job duties. Burnout can also have serious effects on a programmer's health, including depression, anxiety, and physical illness.

There are several warning signs that a programmer may be experiencing burnout, including a **lack of motivation**, **difficulty concentrating**, and **increased irritability**. Other signs may include changes in eating or sleeping patterns, social withdrawal, and a decrease in productivity. If these symptoms persist, it is essential to seek professional help.

To prevent burnout, programmers can take several steps to manage their workload and prioritize their mental health. One crucial strategy is to set realistic expectations for their work and avoid overloading themselves with tasks. Programmers should also make time for self-care activities, such as exercise, hobbies, and spending time with loved ones.

Seeking support from coworkers and supervisors can also be helpful in managing stress and workload, while disconnecting from work outside of business hours can contribute to a healthy work-life balance. By adopting these strategies, programmers can avoid burnout and maintain their productivity and effectiveness in their roles.

Burnout is a significant concern for programmers, and it is essential to recognize the warning signs and take proactive steps to prevent it. By setting realistic expectations, prioritizing self-care, seeking support, and taking breaks, programmers can maintain their passion for their work and avoid the hidden dangers of burnout. It is essential to prioritize your mental health, as this will help you to be a more productive and effective programmer in the long run.
While loop
Tags: beginners, programming, tutorial, cpp
Published: 2023-04-16 04:20:29

Salom dasturchi bugun siz bilan while loop haqida gaplashamiz.
Bugun siz while nima ekanligi va nima uchun kerak yana u bajargan ishlarni oldingi o'tgan mavzuyimiz if else ham qila oladimi yo'qmi ko'rib chiqamiz.

Qani ketdik:
While - mana shunday ko'rinishda bo'ladi : while() 

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

uni ishlashi esa while ichidagi shart folse bo'lguncha davom etadi.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f5xa8lm650gnx6kozhrz.png)
mana shunday ko'rinishda bo'ladi. 

Buni hozir ko'd orqali ham ko'rib chiqishingiz mumkin.

```
#include <iostream>

using namespace std;

int main() {
int i = 1;
    while(i <= 50) 
    {
	cout << "Hello world" << endl;
	i++;
    }
	return 0;
}

```

kabi ko'rinishda ishlaydi.
Biz aslida while ni bitta narsani qayta qayta yozmasligimiz va shunga o'xshash amallarda ishimizni yengillatishi uchun ishlatami. 
                               **Tushuntirish**
Hozir bu kodda Hello world so'zi 50 marta chiqadi.
birinchi o'zgaruvchi yaratib olamiz va uni boshlang'ich qiymati 1 yoki boshlang'ich qiymatini beramiz.
Bu kodda i ya'ni 1 50 dan kichkina bo'lsa ekranga chiqar Hello world ni va bitta qiymat qo'sh _i_ ga agar i 50 dan yuqori bo'lsa ko'd to'xtaydi bungacha takrorlanaveradi.

Bu maqolada ko'p narsani bilib oldingiz dagan umiddaman keyingi maqolalarimgacha xayr sog' bo'ling . Davomi bor !!!
Why has this stopped working in JQuery
Tags: javascript, bootstrap, modal
Published: 2023-04-15 22:21:15

I had a Javascript which opened a modal and then replaced the .modal-body content with the href content (load an external page into the modal body), however it seems to have stopped working. the script is below:
```
$('.vs-modal').on('click', function(e){
      e.preventDefault();
//    alert("CLICK RECEIVED"+$(this).attr('href'));
      $('#ViewStarModal').modal('show').find('.modal-body').load($(this).attr('href'));
    });
```
when the alert is uncommented the alert works so the script is still triggering and it displays the url, but the line after the alert shows the modal but no longer loads the href url
` 
`
and here is the link/trigger created using php

```
  <a class='btn btn-outline-success vs-modal' href='view-star.php?id=".$srow['id']."'><i class='bi bi-eye'></i></a>

```
I just cant see why it has stopped working :(

For some reason I can not post the source for the modal.

USING jquery-3.6.4.js
                  `
Challenges of Working on a Complex Open-Source Project: Lessons from Apache-age
Tags: apacheage, apache, postgres, opensource
Published: 2023-04-16 02:52:57

Working on an open-source project can be a rewarding experience, but it can also come with its fair share of challenges. This is especially true when it comes to working on complex projects like Apache-age, a graph database built on top of PostgreSQL.

One of the biggest challenges of working on a complex open-source project is simply understanding the codebase. Apache-age is a large project with many moving parts, so it can take time to get up to speed and understand how everything fits together. This can be especially difficult if you are new to the project or are not familiar with the programming languages and technologies used.

Another challenge is working with other contributors. Open-source projects often have a distributed team of contributors from all over the world, so communication and collaboration can be difficult. It can be hard to coordinate efforts and make sure everyone is working towards the same goals. It can also be difficult to review and merge pull requests from other contributors, especially if they are not familiar with the codebase or the project's goals.

Navigating the open-source community can also be challenging. There are often many different opinions and approaches to solving problems, and it can be difficult to find the right balance between innovation and maintaining compatibility with existing code. It can also be challenging to manage the project's roadmap and make sure that it aligns with the needs and goals of the community.

Despite these challenges, working on a complex open-source project like Apache-age can be a great learning experience. It can help you develop a deeper understanding of programming languages and technologies, as well as improve your communication and collaboration skills. It can also be a great way to build a portfolio of work that can be used to showcase your skills and experience to potential employers.

In conclusion, working on a complex open-source project like Apache-age can be both rewarding and challenging. By understanding and navigating these challenges, you can develop the skills and experience needed to succeed in the world of open-source software development.
Apache-age: An Introduction to the Graph Database Built on PostgreSQL
Tags: apacheage, apache, postgres
Published: 2023-04-16 02:29:51

Graph databases are a type of database that store and represent data as graphs, with nodes representing entities and edges representing relationships between them. They are becoming increasingly popular for applications that require complex data modeling and querying, such as social networks, recommendation engines, and fraud detection systems.

Apache-age is a graph database built on top of PostgreSQL, a popular open-source relational database management system. It is designed to provide a scalable, high-performance solution for managing and querying large-scale graph data.

One of the key features of Apache-age is its use of the Apache Arrow project, a cross-language development platform for in-memory data. By leveraging Apache Arrow, Apache-age is able to provide fast, efficient data transfer between different programming languages and platforms.

Apache-age also provides a number of built-in graph algorithms, such as PageRank, betweenness centrality, and community detection. These algorithms can be used to analyze and manipulate graph data in a variety of ways, and can be easily integrated into custom applications.

In addition to its performance and algorithm capabilities, Apache-age also provides a number of tools and APIs for managing and querying graph data. These include a SQL-like query language called Cypher, a command-line interface for managing the database, and APIs for interacting with the database programmatically.

If you're interested in working with graph data, or are looking for a scalable, high-performance solution for managing complex data, Apache-age is definitely worth exploring. With its powerful features and robust toolset, it is a great choice for a wide range of graph database applications.
WHY THE RAZER BLACKSHARK V2 PRO IS THE BEST WIRELESS GAMING HEADSET FOR AUDIO ENTHUSIASTS
Tags: gaming, headsets, audio, technology
Published: 2023-04-16 01:58:45


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78z6oc8e9z699zcl6yso.png)
When it comes to gaming headsets, there are a lot of options on the market. However, not all headsets are created equal. Audio enthusiasts know that sound quality is key, and the Razer BlackShark V2 Pro stands out as one of the best wireless gaming headsets for its superior sound quality and range of features. In this article, we'll take a closer look at why the Razer BlackShark V2 Pro is the best wireless gaming headset for audio enthusiasts.

When it comes to gaming headsets, there are many options to choose from. From wired to wireless, noise-canceling to surround sound, gamers have a variety of options available to them. However, not all headsets are created equal. When it comes to immersive gaming experiences, sound quality is essential, and finding the right headset can make all the difference.

[Read more...
](https://www.headphonetip.xyz/2023/04/razer-black-shark-v2-pro-is-the-best-wireless-gaming-headset.html)