teleren/devto huggingface dataset:
Editing react quilljs markdown styling
Tags: webdev, frontend, richtext, markdown
Published: 2023-07-20 17:23:01

I was creating a markdown editor with Quilljs in my nextjs project with tailwind and had problem styling it since I was using light and dark mode.
Well, here is the hack around it 🎊. 

**Since i was using tailwind, the best way was to make sure that quilljs elements were receiving some specific stylings from my parent class, so I could control it easily.** 🤔🤔🤔💭

> 
This is an edited version of the Quill component 
```
//quill component
import { FC } from "react";
import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css";
interface EditorProps {
  className: string;
  placeholder: string;
}

const modules = {
  toolbar: [
    [{ header: [1, 2, false] }],
    ["bold", "italic", "underline", "strike", "blockquote"],
    [{ list: "ordered" }, { list: "bullet" }, { indent: "-1" }, { indent: "+1" }],
    ["link", "image"],
    ["clean"],
  ],
};

const formats = ["header", "bold", "italic", "underline", "strike", "blockquote", "list", "bullet", "indent", "link", "image"];

const Editor: FC<EditorProps> = ({ placeholder, className }) => {

  return (
    <>
      <ReactQuill
        className={className}
        placeholder={placeholder}
        modules={modules}
        formats={formats}
        
      />
    </>
  );
};

export default Editor;

```

> 
Add this to your root css (global.css,main.css or whatever you use)

```
// root css file
.quill > * {
  border-color: inherit !important;
  color: inherit !important;
}
.quill > .ql-toolbar {
  /* border radius of the toolbar */
  border-radius: 10px 10px 0 0;
}
.quill > .ql-container {
  /* border radius of the container and for font size*/
  font-size: inherit;
  border-radius: 0 0 10px 10px;
}
.ql-toolbar.ql-snow .ql-picker-label {
  color: inherit !important;
  opacity: 0.76;
}
.ql-snow .ql-picker {
  color: inherit !important;
}
.quill > .ql-container > .ql-editor.ql-blank::before {
  /* for placeholder */
  color: inherit;
}
.ql-snow.ql-toolbar button svg {
  opacity: 0.76;
  color: currentColor;
}
.ql-snow .ql-stroke {
  /* for the border of the editor */
  stroke: currentColor !important;
}
.ql-snow .ql-fill {
  /* for the bg color */
  fill: currentColor !important;
}
.ql-picker-item {
  /* for dropdown */
  color: #444 !important;
}

```

> 
Use it in your page or component

```
<Editor
   className="my-4 dark:border-secondary-40 border-gray-500 rounded-md text-gray-800 dark:text-white lg:text-xl text-lg"
   placeholder={"Write something here..."}/>
```

**RESULTS 😍😍😍**
![Dark mode result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bf8eedj3dqj2vjl9n959.png)

![Light Mode result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7b7xj8v5lvzmgh0mil0d.png)

I'll love to get some opinion and answer questions you may have.
Arithemetic Operators in C++
Published: 2023-07-20 17:20:14

Arithmetic operators are used for performing basic mathematical operations on variables or values. C++ provides a set of standard arithmetic operators that you can use to perform addition, subtraction, multiplication, division, and more. Let's go through each arithmetic operator one by one:

#### 1. Addition (+):

The addition operator (+) is used to add two operands together.

```cpp
int a = 10;
int b = 20;
int result = a + b; // result will be 30
```
#### 2. Subtraction (-):
The subtraction operator (-) is used to subtract the right-hand operand from the left-hand operand.

```cpp
int a = 50;
int b = 30;
int result = a - b; // result will be 20
```

#### 3. Multiplication (*):
The multiplication operator (*) is used to multiply two operands.

```cpp
int a = 5;
int b = 6;
int result = a * b; // result will be 30
```

#### 4. Division (/):
The division operator (/) is used to divide the left-hand operand by the right-hand operand.

```cpp
int a = 50;
int b = 5;
int result = a / b; // result will be 10
```

#### 5. Modulus (%):
The modulus operator (%) is used to find the remainder when the left-hand operand is divided by the right-hand operand.

```cpp
int a = 20;
int b = 6;
int result = a % b; // result will be 2 (remainder of 20 / 6)
```

#### 6. Increment (++) and Decrement (--):
The increment operator (++) is used to increase the value of a variable by one, and the decrement operator (--) is used to decrease the value of a variable by one.

```cpp
int a = 5;
a++; // a will be 6
a--; // a will be 5 again
```

#### 7. Compound Assignment Operators (+=, -=, *=, /=, %=):
C++ also provides compound assignment operators, which combine an arithmetic operation with assignment.

```cpp
int a = 10;
a += 5; // equivalent to a = a + 5; (a will be 15)
a -= 3; // equivalent to a = a - 3; (a will be 12)
a *= 2; // equivalent to a = a * 2; (a will be 24)
a /= 4; // equivalent to a = a / 4; (a will be 6)
a %= 5; // equivalent to a = a % 5; (a will be 1)
```

Keep in mind that arithmetic operators have certain rules and precedence in C++. Parentheses can be used to control the order of evaluation.

Remember to use appropriate data types when using arithmetic operators to avoid potential overflow or precision issues, especially with floating-point numbers.

That's a summary of arithmetic operators in C++. They are essential for performing basic mathematical calculations in your C++ programs. Happy coding!
TaleTrove: An app for authors to write stories and publish immediately
Tags: refinehackathon
Published: 2023-07-20 17:15:52

## What I built 
I built an application who authors who don't have access to publication houses. These authors can use this app to immediately write and publish their stories.

### Category Submission: 

1. Best Overall Project
2. Most Visually Pleasing
3. Most Technical Impressive
4. Best Project built using Material UI as the main UI framework for the refine app

### App Link

### Screenshots 

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

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

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

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

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

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


### Description 
In this project, I created the whole backend with various routes that allows you to apply CRUD operations on authors and books. Then used Refine on the client side to create the required pages to implement the routes that I created on the  server side. I have used REST API, Mongoose and MongoDB on backend.

### Link to Source Code 
https://github.com/swapn652/taletroverserver
https://github.com/swapn652/taletroverclient

### Permissive License 
MIT

## Background (What made you decide to build this particular app? What inspired you?) 
I just thought that authors have to depend on publishing houses to get their books published, which is probably a tiring task as your book might get rejected. So, how about if there was a site where you can write you story and publish it directly and the interested readers can read it immediately.

### How I built it (How did you utilize refine? Did you learn something new along the way? Pick up a new skill?) 

First I decided the tools that I will use to create the application.

I used MongoDB, Refine, React, Vite and Refine to create this project.

I used Refine to make the task of authentication easier, i.e., both the register and login process. Then I used refine to create a new resource entitled books with the required paths.

### Additional Resources/Info
https://refine.dev/docs
https://mui.com/material-ui/getting-started/
Check if the given string is a palindrome or not
Tags: javascript, beginners, programming, interview
Published: 2023-07-20 17:13:17

## This problem was asked by Intuit.

**Given a string of characters, Check if the given string is a palindrome or not. A palindrome is a word, phrase, or sequence that reads the same backward as forwards, e.g. "racecar" or nurses run.**

```
Example
function palindromeCheck(str) {

}

let str = "race car";
console.log(palindromeCheck(str)); // false
```

**Solution**

```
function palindromeCheck(str) {
   let left=0, right= str.length-1

   while(left<right){
    if(str[left] !== str[right]) return false
    left++
    right--
   }
   return true
}

let str = "nursesrun";
console.log(palindromeCheck(str)); // true
```

**Explanation:**

- Preprocess the string to simplify checking - lowercase and remove non-alphanumerics
- Use two pointers starting at each end of the string
- Move the pointers inward, comparing characters
- If any character pair doesn't match, return false
- If pointers meet in the middle, all characters match so return true
Newbie's first project - give me your best advice!
Tags: python, beginners, programming
Published: 2023-07-20 17:11:59

Hi!
My name is Kristof. I recently started a course on Codecademy that teaches me the basics of Computer Science. I feel like it's a great path for me since I'm pursuing a career in this field. I'm super new to the language and I'm just trying to figure out some basic stuff. So I thought I would share my first ever completed project!
I'm posting here because I hope I can fetch some useful advice from you guys!
oh btw it's a BlackJack terminal game.

Thanks for your input and take care!

https://github.com/knov1115/PythonProjects
How to Identify Most Called Stored Procedures in SQL Server
Tags: sqlserver
Published: 2023-07-20 17:09:53


In managing a SQL Server, one of the key responsibilities is ensuring the server runs efficiently. The efficiency of your stored procedures can greatly impact the overall performance of your database. The first step in optimizing stored procedures is identifying which procedures are called most often.

## Why Optimizing Stored Procedures is Important?
Stored procedures are pre-compiled SQL statements that are stored in the database. These statements can be reused over and over again by applications, which can improve performance because the database engine doesn't have to parse, compile, and optimize the SQL statement every time it is run. 

Poorly written or inefficiently structured stored procedures can degrade the performance of your database, leading to slower application performance and increased resource consumption. This is why optimizing stored procedures is essential.

## How to Identify Most Called Stored Procedures
When you execute the following SQL statement, you will get a list of stored procedures, orders by most called

```SQL
SELECT
    OBJECT_NAME(object_id) AS [ProcedureName],
    execution_count AS [ExecutionCount]
FROM
    sys.dm_exec_procedure_stats
WHERE not OBJECT_NAME(object_id) is null
ORDER BY execution_count DESC
```

This SQL Query sorts the results by the `execution count` attribute, effectively showing the stored procedures that have been called the most.

## How to Reset Stored Procedures Statistics + Implications
Resetting the stored procedure's statistics can be done using the `DBCC FREEPROCCACHE` command. It clears the plan cache for the SQL Server instance, effectively resetting the statistics for all stored procedures. 

```SQL
DBCC FREEPROCCACHE
```

**Warning** keep in mind that resetting statistics using `DBCC FREEPROCCACHE` should be used with caution. It removes all elements from the plan cache, which forces the SQL Server to recompile all subsequent execution plans, causing a temporary decrease in performance. 

In addition, any plans that are being used will continue to reside in memory. Therefore, the operation doesn't necessarily free up a significant amount of memory. The `DBCC FREEPROCCACHE` command is most useful when you want to test stored procedure performance with a fresh cache or when you know a significant change has occurred in your data distribution and you want to ensure the stored procedures compile with the most up-to-date statistics.

## In summary
optimizing stored procedures is an essential task for maintaining efficient database operation. Begin by identifying which stored procedures are called the most frequently, then focus on these procedures when you're optimizing. Remember to use caution when resetting statistics, considering the potential performance implications.
first non-repeating character.
Tags: javascript, programming, beginners, interview
Published: 2023-07-20 17:08:32

## This problem was asked by SAP Labs.

**Given a string of characters, return the index of the first non-repeating character.**

```
Example
function nonRepeatingFirstCharacter(str) {

}

const str = "abcdcaf";
console.log(nonRepeatingFirstCharacter(str)); // 1
Explanation: The non-duplicate characters in the above string are b, d and f. Since b occurs first, the index of b, which is 1 is returned.
```

**Solution**

```
function nonRepeatingFirstCharacter(str) {
  const map = new Map();
  for (const char of str) {
    map.set(char, (map.get(char) || 0) + 1);
  }
  for (let i = 0; i < str.length; i++) {
    const char = str[i];
    if (map.get(char) === 1) return i;
  }
  return -1;
}

const str = "abcdcaf";
console.log(nonRepeatingFirstCharacter(str)); // 1

```

**Explanation:**

- Use a hash table (object) to store count of each character in one pass
- Increment count if character is already in table, default to 1
- Then loop through string again checking if char count is 1
- Return index immediately if non-duplicate char found
How to Earn Money with Facebook ?
Tags: earnmoney, facebook, socialmedia, earnmoneyonline
Published: 2023-07-20 16:50:52


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iz5xqn3ajnsz5bxpve5b.jpg)](https://www.indiantechnologyskills.tech/2023/07/how-to-earn-money-with-facebook.html)

[How to Earn Money with Facebook?](https://www.indiantechnologyskills.tech/2023/07/how-to-earn-money-with-facebook.html) Facebook, the world's largest social media platform, not only connects billions of people but also provides countless opportunities for individuals to earn money. Whether you're an entrepreneur, content creator, or just looking to earn some extra income, Facebook offers a variety of ways to monetize your presence on the platform.

[Read more...](https://www.indiantechnologyskills.tech/2023/07/how-to-earn-money-with-facebook.html)
Calling for 100 builders
Tags: opensource, hackathon, ai, web3
Published: 2023-07-20 16:47:58

Hi everyone,

I'm so happy to share that we opened up [100 Builders](https://100.builders), a **4-week fully online program for people to build and collaborate on bold open source projects in AI and crypto**, organized by our small team Backdrop and supported by amazing partners and sponsors. 

It is 100% free, and 100% on builders' terms - just a BIG build-that-thing energy for all 100 projects that get selected to participate. 

**Why open source? you ask...**
The battle between open and closed in tech rages on, and even more so in the frontier like AI and Crypto. **We have always sided with builders**, and builders always side with **open technology**. So, we're here to give open a little extra weight!

We have a lot more to announce, including details about $20k+ (and counting) in sponsorship for participants. If you are big on building more open tech for AI and Crypto, head to https://100.Builders to apply. It takes 2 minutes.

**Applications close on August 10th.**

There is a little FAQ here: https://docs.100.builders/100-builders-qs-and-as but you can also shoot an email with any questions to [community@100.builders](mailto:community@100.builders).

If you want more updates on twitter, you can follow our [Backdrop account](https://twitter.com/withBackdrop).

We're STOKED to build awesome, open tech together!
Top 10 Best Video Editing Apps
Tags: bestvideo, editingapp, videoediting, videoeditor
Published: 2023-07-20 16:34:03


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/esepuhnhst3q6rs0le0r.jpg)](https://www.indiantechnologyskills.tech/2023/07/top-10-best-video-editing-apps.html)

[Top 10 Best Video Editing Apps.](https://www.indiantechnologyskills.tech/2023/07/top-10-best-video-editing-apps.html) Video editing apps have become essential tools for content creators, vloggers, and even casual users looking to add interest to their videos. Top 10 Best Video Editing Apps. With so many video editing apps available, finding the right one can be overwhelming. [Top 10 Best Video Editing Apps.](https://www.indiantechnologyskills.tech/2023/07/top-10-best-video-editing-apps.html) To help you navigate through the options and make an informed decision, we have compiled a list of the top 10 best video editing apps in 2023. Top 10 Best Video Editing Apps.

[Read more...](https://www.indiantechnologyskills.tech/2023/07/top-10-best-video-editing-apps.html)
66 berufliches Vorwärtskommen: Wie die Arbeit in den Lagern aussieht.
Tags: deutsch, career, motivation, discuss
Published: 2023-07-20 16:14:00

Moin Moin,

will man menschliche Arbeit durch Maschinen ersetzen, so arbeitet man wohl an Projekten wie ChatGPT und an Robotern.
Möchte man hingegen menschliche Arbeit durch Maschinen ergänzen, so arbeitet man wohl an Projekten wie [Palantir↗](https://www.palantir.com/). 

Palantir ist ein Unternehmen des PayPal-Mitgründers, [Peter Thiel↗](https://www.thielfoundation.org/team), welches unter anderem Finanzbetrug durch die Verknüpfung von maschineller und menschlicher Datenauswertung aufdeckt. Peter Thiel erzählt in seinem Buch, Zero to One, dass vor Palantir die sogenannte NSA der USA einen reinen Maschinenansatz fuhren und die sogenannte CIA der USA rein auf menschliche Arbeit setzte. Palantir erziele ihm nach bessere Ergebnisse als beide Organisationen, so dass Banken, Versicherungen und Regierungen Kunden von Palantir sind.

Ausführungen über ChatGPT und Roboter habe ich mir erspart, da mir diese in aller Munde zu sein scheinen.


1) Meint ihr, dass es bald eine Software gibt die Palantirs Auswertungs-Software ersetzten kann? ChatGPT?
2) Meint ihr, dass sogenannte KI-Software und Roboter durch Werkzeuge ersetzt werden die von Menschen geführt werden?


Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Oder auch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch
Building a Fantasy Football Mock Draft Simulator in Python
Published: 2023-07-20 16:08:50

## Introduction:

Fantasy football mock draft simulators are a valuable tool for fantasy football enthusiasts to practice their drafting skills, experiment with different strategies, and prepare for the real draft day. In this blog post, we will walk you through the process of creating a simple yet effective fantasy football mock draft simulator in Python.

## Step 1: Define the Player Data

To begin, we need to define the player data, including player names, positions, projected points, and average draft positions (ADP). We can represent this data using a list of dictionaries, where each dictionary corresponds to a player.

```
#Sample player data
players = [

    {"name": "Player A", "position": "RB", "projected_points": 
    200, "adp": 1},
    {"name": "Player B", "position": "QB", "projected_points": 
    180, "adp": 2},
    {"name": "Player C", "position": "WR", "projected_points": 
    170, "adp": 3},
    # Add more players as needed

```

## Step 2: Initialize the Draft Simulator

Next, let's create a function to initialize the draft simulator. This function will set up the necessary variables to conduct the mock draft, such as the draft order and the number of rounds.

```
def initialize_mock_draft():
    draft_order = ["Team A", "Team B", "Team C", "Team D"]    # Replace with your team names
    drafted_players = []
    rounds = 15  
# Adjust the number of rounds based on your league settings

    return draft_order, drafted_players, rounds

```

## Step 3: Implement the Draft Algorithm

The draft algorithm will be the heart of our simulator. It will determine each team's draft pick based on their position needs and player rankings.


```
def draft_pick(team, available_players, drafted_players):
    best_player = None
    for player in available_players:
        if player not in drafted_players:
            if best_player is None or player['adp'] < best_player['adp']:
                best_player = player

    drafted_players.append(best_player)
    return best_player

```

## Step 4: Run the Draft Simulation

With the initialization and draft pick functions in place, we can now run the mock draft simulation.

```
def run_mock_draft():
    draft_order, drafted_players, rounds = initialize_mock_draft()
    available_players = players.copy()

    for round in range(1, rounds + 1):
        print(f"--- Round {round} ---")
        for team in draft_order:
            print(f"{team}'s Pick:")
            picked_player = draft_pick(team, available_players, drafted_players)
            print(f"Selected: {picked_player['name']} ({picked_player['position']})")
            print("-----------------------")

if __name__ == "__main__":
    run_mock_draft()

```

## Conclusion:

By defining player data, initializing the simulator, implementing the draft algorithm, and running the simulation, you now have a tool to practice and refine your fantasy football draft strategy.
Best Android Phones Under 25000
Tags: best, android, smartphone, mobile
Published: 2023-07-20 16:07:08


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3v2x2tyr6hnok6hb36km.jpg)](https://www.indiantechnologyskills.tech/2023/07/best-android-phones-under-25000.html)

[Best Android phones under 25000](https://www.indiantechnologyskills.tech/2023/07/best-android-phones-under-25000.html), which are designed to offer great performance and excellent value for your money. Best Android Phones Under 25000. These smartphones boast of powerful processors, great displays, advanced camera systems, and long-lasting batteries. Best Android Phones Under 25000.

[Read more...](https://www.indiantechnologyskills.tech/2023/07/best-android-phones-under-25000.html)
Devops Notes
Published: 2023-07-20 15:50:07

**What is DevOPs?**
There are lot of definition exist but in simple words it's all about development and operations. We automate things in it because manual work takes a lot of time to complete.

**What is CD/CI?**
**CI** means **Continuous Integration**. Let's suppose developers are coding for more than 3 weeks and after 3 weeks they take rest but when the code goes to build and testing. They find a lot of errors. This thing Just Sucks. So, We need to automate deployment so that we can see errors as soon we push our code or commit then automatically build and test and tells the errors if come
Now, So we can use different tools for it like Jenkins, Circle CI etc.

**CD** means **Continuous Development**. Now, we have automate things from the development end and a lot of code coming to operations team because of automation. Now, we have to automate operations and testing. So, Continuous Delivery means The code automatically deploy on server and after deployment further testing can be performed by QA but this can also be automated. We can write automated test cases for our code.
Top 10 Best Gaming Laptops 2023
Tags: gaminglaptop, gamingpc, gamingsetsup, bestlaptops
Published: 2023-07-20 15:42:21


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kuwthk33gv19c12sk2xk.jpg)](https://www.indiantechnologyskills.tech/2023/07/top-10-best-gaming-laptops-2023.html)

[Top 10 Best Gaming Laptops 2023.](https://www.indiantechnologyskills.tech/2023/07/top-10-best-gaming-laptops-2023.html) Gaming laptops have come a long way in providing the best gaming experience with a combination of portability and high-performance hardware. Top 10 Best Gaming Laptops 2023. In 2023, the gaming industry continues to push the boundaries, and so do laptops designed to meet the needs of avid gamers. Top 10 Best Gaming Laptops 2023.

[Read more...](https://www.indiantechnologyskills.tech/2023/07/top-10-best-gaming-laptops-2023.html)