teleren/devto huggingface dataset:
REVERSE A STRING LEETCODE SOLUTION 2 c++
Tags: webdev, beginners, programming, tutorial
Published: 2023-07-10 05:17:06

DESCRIPTION:
Write a function that reverses a string. The input string is given as an array of characters s.

You must do this by modifying the input array in-place with O(1) extra memory.

 

Example 1:

Input: s = ["h","e","l","l","o"]
Output: ["o","l","l","e","h"]
Example 2:

Input: s = ["H","a","n","n","a","h"]
Output: ["h","a","n","n","a","H"]
 

Constraints:

1 <= s.length <= 105
s[i] is a printable ascii character.




1.STRING GIVEN EG: RUPA
2.CHAR ARRAY GIVEN EG: ["R","U","P","A"]



1.STRING GIVEN EG: RUPA

SOLUTION C++:

```
#include <bits/stdc++.h> 
using namespace std; 
  
void reverse(string s){ 
   for(int i=s.length()-1; i>=0; i--) 
      cout<<s[i];  
} 
  
int main(){ 
    string s = "Rupa"; 
    reverse(s); 
    return 0; 
}

```


2.2.CHAR ARRAY GIVEN EG: ["R","U","P","A"](LEETCODE SOLUTION)

SOLUTION C++;

```
class Solution {
public:
    void reverseString(vector<char>& s) {
        int n=s.size();
        int l=0;
        int r=n-1;
        while(l<=r){
            swap(s[l],s[r]);
            l++;
            r--;
        }
        

    }
};
```
What is Overloading in Java?
Tags: java
Published: 2023-07-07 07:48:01

In Java, overloading refers to the capability of defining multiple methods with the same name but different parameters within a class. It allows developers to provide multiple ways of invoking a method based on the types and number of arguments passed to it. Overloading is a form of polymorphism, where different methods can have the same name but perform different tasks depending on the context and parameters.

By overloading methods, developers can create more flexible and intuitive APIs that cater to different use cases and provide convenience to the users of the class. When a method is overloaded, the compiler determines which specific version of the method to invoke based on the arguments passed during the method call.

To overload a method in Java, developers must ensure that the methods have different parameter lists. The parameters can differ in terms of the number of parameters, their types, or both. Method overloading is not limited to the parameters' names or return types; only the parameters' types and their order matter in distinguishing between overloaded methods.

When a method is called, the Java compiler matches the arguments passed to the available overloaded methods based on their types and selects the most appropriate one. If an exact match is not found, the compiler attempts to find a compatible match through implicit type conversions or promotions. If multiple matches are found, the compiler selects the most specific one. By obtaining [Java Certification](https://www.edureka.co/java-j2ee-training-course), you can advance your career in Java. With this course, you can demonstrate your expertise in Core Java & J2EE basic and advanced concepts and popular frameworks like Hibernate, Spring & SOA, many more fundamental concepts, and many more critical concepts among others.

Overloading methods can provide several benefits in Java programming. It improves code readability and maintainability by allowing developers to use intuitive and descriptive method names. It also enhances code reusability by offering flexibility in method invocation. Overloaded methods can provide default values for optional parameters, avoiding the need for multiple methods with different parameter combinations.

It's important to note that overloading methods do not change their visibility modifiers, return types, or exceptions thrown. Overloaded methods are distinct entities within a class, and they are resolved at compile-time based on the method call and arguments' types.

In summary, overloading in Java allows developers to define multiple methods with the same name but different parameter lists within a class. It enables the creation of more flexible and intuitive APIs by providing multiple ways of invoking a method based on the types and number of arguments passed. Method overloading enhances code readability, reusability, and convenience for users, while the Java compiler determines the appropriate method to invoke based on the arguments' types during compilation.
How to copy style from any website
Published: 2023-07-10 05:10:38

Would you like to copy the design style code from any website on the internet? With one-click? In CSS or Tailwind CSS?


{% embed https://www.youtube.com/embed/QxPAsDSOIrI %}


I created a tool ([DivMagic](https://divmagic.com)) which lets you copy any element from any website and convert it into HTML/JSX(React)/CSS/Tailwind CSS component.



![Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yd1fzzd3frmqqxdn84wq.gif)

Check it out at https://divmagic.com
Enable 2FA MFA For Your Build Process
Tags: security, cicd, github, developers
Published: 2023-07-10 04:56:16

## What is 2FA/MFA?

For modern digital life, it’s hard to avoid [Two-Factor Authentication (2FA)](https://www.investopedia.com/terms/t/twofactor-authentication-2fa.asp)/[Multi-Factor Authentication (MFA)](https://en.wikipedia.org/wiki/Multi-factor_authentication). You may see the term 2FA and/or MFA though both apply to authentication, which is the act of verifying a user can access a website, application, or service.

At minimum you need a username or email as sign in credentials, and you need something else:

* you (biometrics)
    
* thing (hard or soft token)
    
* and, something you know (password).
    

The most common MFA is when a user logs into an app they are prompted to check their email or SMS for a code. This code should be a [OTP - one-time password/passcode](https://www.twilio.com/blog/what-does-otp-mean).

## Use 2FA/MFA in your build process

* First are you using GitHub, GitLab, BitBucket to host your code?
    
* Enable 2FA/MFA on your account.
    
* Enable ***verified commits*** for your developer laptop/environment.
    
## Verified Commits

Next week, I’ll show you how to enable verified commits for your developer environment…because even [Big Tech](https://www.bleepingcomputer.com/news/security/github-notifies-owners-of-private-repos-stolen-using-oauth-tokens/) makes mistakes. 😳


---

Photo by <a href="https://unsplash.com/@impelling?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Ed Hardie</a> on <a href="https://unsplash.com/photos/RMIsZlv8qv4?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
PostgreSQL Basics: Exploring SELECT DISTINCT
Tags: postgres, beginners, tutorial
Published: 2023-07-10 04:53:07

In this tutorial, we will be exploring `SELECT DISTINCT` and how to use them for removing duplicate rows form the result set returned by PostgreSQL query.

## Introduction
As, we know when we run `Select` statement. It returns some data and that data contains duplicates sometimes. Hence, `Distinct` clause is used to discard all the duplicates. `Distinct` clause can be used on single or multiple columns.

## Basic Syntax

```
SELECT DISTINCT column
FROM table_name;
```
Here, column will be used to evaluate duplicates.
It is also possible to use multiple columns for evaluating the duplicates.
Only thing we need to do is to define multiple columns after `distinct`.

```
SELECT DISTINCT column1, column2
FROM table_name;
```
In this scenario, the evaluation of duplicates will consider the combination of values found in both the column1 and column2 columns.

## Examples

Assume we have following table named distinct_demo.

![Table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkngagofd1kggbpw4kx3.png)

let's use `distinct` only on one column.

**Code**

```
SELECT DISTINCT bcolor
FROM distinct_demo
ORDER BY bcolor;
```
**Output**

![Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eg9n8ve4ybhel63yj0cx.png)

Now, let's consider the case of using `distinct` on multiple columns.

**Code**

```
SELECT DISTINCT bcolor, fcolor
FROM distinct_demo
ORDER BY bcolor, fcolor;
```
**Output**

![Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycq39489slxw2qxe91e6.png)

When we used the `SELECT DISTINCT` clause in PostgreSQL, specifying both the bcolor and fcolor columns, the database considered the combined values of both columns to determine the uniqueness of each row. The query results displayed the distinct combinations of bcolor and fcolor from the distinct_demo table. It is important to note that the distinct_demo table contained two rows with the value "red" in both the bcolor and fcolor columns. However, when the DISTINCT was applied to both columns, one of those rows was eliminated from the result set since it was considered a duplicate.
REVERSE INTEGER -LEETCODE SOLUTION C++
Tags: beginners, programming, tutorial, learning
Published: 2023-07-10 04:44:32



Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.

Assume the environment does not allow you to store 64-bit integers (signed or unsigned).

 

Example 1:

Input: x = 123
Output: 321
Example 2:

Input: x = -123
Output: -321
Example 3:

Input: x = 120
Output: 21
 

Constraints:

-231 <= x <= 231 - 1




SOLUTION C++

```
class Solution {
public:
    int reverse(int x) {
        int num = x;
        long int rev = 0;
        while(num != 0){
            int digit = num%10;
            rev = 10*rev + digit;
            if(rev > INT_MAX)return 0;//1
            if(rev < INT_MIN)return 0;//2
            num/=10;
        }
        return (int)rev;
    }
};
```
LINE 1 AND 2 used due to if their is any negative values exist
Tips and techniques for technical writing.
Tags: writing, technicalwriting, contentwriting, howto
Published: 2023-07-10 04:32:18




**The goal of technical writing.**

The main target of technical writing is to convey information to its audience about a technical tool, idea, software, or concept.

Here are tips for becoming a better writer.

1.**Accuracy and research.**

As a technical writer, providing accurate information about the subject matter is crucial. Doing proper research and reading documents on the concept is a great way of providing an accurate piece of information.

Feynman technique also helps in improving your knowledge and understanding of the subject matter.

2.**Make your work simple and clear.**

A document will be highly appreciated if it is easy to comprehend. Your document should be straightforward and with all the essential information laid out.
Avoid unnecessary sentences, grammars and define your abbreviations boldly before use.

3.**Use of visuals.**
Including diagrams, flowcharts and screenshots in your document makes it visually appealing and organized. Also, it is a great way of conveying certain information that cannot be expressed using just written words.

4.**Provide a proper outline**.

Always Lay out the content of your document in the order in which it is written to give your readers the knowledge of what to expect.

5.**Communication skills**.

Information can't be disseminated if the writer can't express themselves. Use of active voice when writing, error-free sentences, correct punctuation, and the right grammar go a long way in putting together a great document.

6.**Know your audience.**

Being aware of the end users of your document is important in helping you construct a friendly and comprehensive document. Sometimes it is said you should feel like the targeted audience for you to be able to put out a reader-friendly document.

7.**Avoid all kinds of Plagiarism.**

Putting Out an original document is vital and it points down to you as the writer. Always do your research, and try getting the user experience in other to improve your knowledge about the subject matter. Read documents and seek out from experts. Put out your ideas and concepts.

8.**Editing and proofreading.**

Going Through your written document to do a proper refactoring of errors such as incorrect punctuation, unnecessary information, wrong grammar, spelling, and typo errors will help improve the quality of the document.

Extra: Participate in open-source projects and share your ideas on dev.to
PostgreSQL Basics: Exploring Order By
Published: 2023-07-10 04:13:43

In this tutorial, we will be exploring `Order By` and how to use them for sorting results returned by `Select` statement.

## Introduction
As, we know when we run `Select `statement. It returns some data and that data is in unsorted form. Hence, `Order By` is used to sort data returned by `Select `statement in ascending or descending order based on the expression provided.

## Basic Syntax
```
SELECT select_list
FROM table_name
ORDER BY sort_expression1 [ASC | DESC], sort_expression2 [ASC | DESC], ......, sort_expressionN [ASC | DESC]
```
Here, we can provide multiple sort_expression separated by `,` to sort our data. It sorts based on the sequence. First according to first expression then second and so on. 
We can use either `ASC` for ascending or `DESC` for descending.

**Note:** `ASC` is by default. Hence, if you use nothing it will sort data in ascending order.

Following is the flow of the PostgreSQL statements during execution.

![Flow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/punaayu4v400eo314y2z.png)

Hence, because of this order. It is possible to use column alias defined in `Select` clause in `Order BY` clause.

## Examples
Assume we have customer table and we run following query.

![Customer Table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vacsi2wtnupyrymyx9w.png)

**Code**

```
SELECT first_name, last_name
FROM customer
ORDER BY first_name ASC;
```
**Output**
![Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bgxckhv8vb1o12um3afe.png)

As, we discussed earlier that `ASC` is default. Hence, we could write our query as following too.

**Code**

```
SELECT first_name, last_name
FROM customer
ORDER BY first_name;
```
It will generate same results.

Now, let's sort in descending order.

**Code**

```
SELECT first_name, last_name
FROM customer
ORDER BY last_name DESC;
```
**Output**

![Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7nmtk5d8oo8utuj0ug66.png)

Let's sort using multiple column!

**Code**

```
SELECT first_name, last_name
FROM customer
ORDER BY first_name ASC, last_name DESC;
```
**Output**

![Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k7yql571njhw02y8by0e.png)
As you can observe, it first sorts based on first name in ascending order then it sorts based on last name in descending order.
Music Monday — What are you listening to? (Pets Edition)
Tags: watercooler, discuss, music
Published: 2023-07-10 04:00:00

_cover image source: [Giphy](https://giphy.com/gifs/mice-BjCMpaEqFpIfC)_

**Alright, I know this is a weird edition, but hear me out! Those of you with pets, do you have certain theme songs for your different pets? I bet you do. Some of you might even have pets that are named after songs! Don't have a pet at all, don't worry... just imagine you have a pet. What would you sing to your imaginary pet? Haha, yep, like I said, it's weird. Just humor me and roll with it!**

![A cat banging on a tambourine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54vaeuu1i6mp5dxethfu.gif)

***

## How we do 

In this weekly series, folks can chime in and drop links to whatever it is they've been listening to recently + browse others suggestions. You can follow the suggested genre if you'd like, but don't feel confined to it; you're free to suggest whatever you wanna. 🙌  

If you're interested in having other discussions about music, consider following the aptly named [#music discussions](https://dev.to/music-discussions) organization.

{% embed https://dev.to/music-discussions %}  

***

Alright, alright, let's listen to some tunes. _Note: you can embed a link to your song using the following syntax `{% embed https://... %}`. This should work for most common platforms!_

Looking forward to listening to y'all's suggestions! 🎶
AskDividend: Simplifying Dividend Calculations [India Edition]
Tags: python, programming, india
Published: 2023-07-10 03:53:50

## Introduction 
Programming is often seen as a complex and serious task, but it can also be incredibly fun and rewarding. In this blog post, we'll explore how I wrote a simple Python automation to. calculate the total dividend amount I received from my stocks investments. So, grab your favorite beverage, sit back, and let's dive into the world of programming fun!

## The Problem 
So, It's that time of the year again, when everyone is worried about filling out ITR (Income Tax Returns) before the deadline arrives. For me personally, It's always a tedious task that I procrastinate to complete till the last moment. One common thing where I struggle every year is to manually calculate the dividends I have received from my stock investments. I use the [groww](https://groww.in/) app to do all my investments, and the app does not give me the dividend report. So I need to go through my yearly bank statement to find all the dividends credit. As you can imagine, It's a boring and mundane task 😭. I am sure, almost all the people who invest in stocks, would have to go through the same process.

## Python to the Rescue
Instead of doing the same thing manually this year, I thought of writing a simple Python script that can calculate the dividends from my bank statement. Sounds fun, right 🤩?

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

I figured out that dividends are always credited with certain keywords in transaction summary. It was fairly simple to get the CSV file for yearly bank statements and then I crawled through it to find all the credit transactions with those keywords. And Voila, It works ✌️ !!

I recently came across the framework called Streamlit in python that lets you easily share your work with everyone by hosting your scripts with simple UI. I wrapped my script with some simple UI elements and managed to host it so that I can share it with friends.


🥁🥁🥁🥁 !!!!!! Drum Rolls here !!!!!!! 🥁🥁🥁🥁

I present to you **_ask-dividend_**: https://ask-dividend.streamlit.app/

It just takes your bank name and a CSV file for your bank statement as input, to show you the dividend amount you received along with all dividend credit transactions.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nq21bejy67vag6fzwg9u.png)
It currently supports 2 banks: **SBI** and **HDFC**. 

And yes, It's just a hosted script within a UI application so your financial data is safe and not going anywhere. Pinky Promise 😄 !!!

**Source code**: https://github.com/piyushchhabra/streamlit-experiments/blob/main/dividend.py

Do share If you have also written code to automate boring stuff, I would love to see!!

Thanks for reading !!!
Dive into Web Development: BishnoiWeb's Beginner's Guide to HTML5
Tags: webdev, bishnoiweb, html
Published: 2023-07-10 03:47:21

New to web development? Don't worry, we've got you covered! Bishnoi Web presents a comprehensive beginner's guide to HTML5. Learn the fundamentals, understand semantic markup, and create structured web pages. Follow our guide step by step and embark on your journey to becoming a skilled web developer. Let's code together!
Level up Your Web Design Skills with BishnoiWeb's UI/UX Templates
Tags: bishnoiweb, webdesign, uiux
Published: 2023-07-10 03:46:20

Designing captivating user interfaces and experiences is now easier than ever! BishnoiWeb's collection of UI/UX templates is perfect for both beginners and seasoned designers. Explore our repository and discover a range of professionally designed templates to inspire your next web project. Elevate your web design skills with Bishnoi Web!
Web Development Tip of the Day: Optimize Your CSS with BishnoiWeb's CSS Framework
Tags: bishnoiweb, webdev, css
Published: 2023-07-10 03:45:04

Struggling with CSS optimization? Look no further! BishnoiWeb's CSS framework is here to simplify your styling process. With pre-built classes and responsive design support, you can create beautiful and efficient CSS code. Boost your web development workflow and achieve stunning results with our framework. Try it out now!
JavaScript - copyWithin() Method
Tags: javascript, webdev, programming, kristiyanvelkov
Published: 2023-07-10 03:45:00

The **copyWithin()** method allows you to copy a sequence of elements within an array to another position within the same array. It modifies the original array in place and returns a reference to the modified array.

---

## The syntax for **copyWithin()** is as follows:

```typescript
array.copyWithin(target, start, end)
```

- **target**: The index at which to copy the elements to. It can be a positive or negative number. If it is negative, it will be counted from the end of the array. If the target index is greater than or equal to the length of the array, no elements will be copied.

- **start**: The index at which to start copying elements from. It is optional and defaults to 0 if not provided. If it is negative, it will be counted from the end of the array.

- **end**: The index at which to stop copying elements from. It is optional and defaults to the length of the array if not provided. If it is negative, it will be counted from the end of the array.

--- 

## Example: 

```typescript
const array = [1, 2, 3, 4, 5];

// Copy elements starting from index 3 to index 0
array.copyWithin(0, 3);
console.log(array); // Output: [4, 5, 3, 4, 5]

// Copy elements starting from index 1 to index 3
array.copyWithin(3, 1, 2);
console.log(array); // Output: [4, 5, 3, 5, 5]
```

---

## Browser compatibility 

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


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


[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kristiyan-velkov-763130b3/)

<a href="https://revolut.me/kristiyanvelkov" target="_blank">
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxmsw2d2ooukhdg8x5ar.png)
</a>

If you like my work and want to support me to work hard, please donate via:

<a href="https://revolut.me/kristiyanvelkov" title="Link to Revolut">Revolut website payment</a> or use the QR code above.                                                                                                                           


**Thanks a bunch for supporting me! It means a LOT 😍**
Calling All Web Developers: Contribute to BishnoiWeb's Open-Source Projects
Tags: webdev, opensource, bishnoiweb
Published: 2023-07-10 03:42:58

Attention, web development enthusiasts! BishnoiWeb is calling for contributors to join our open-source projects. Whether you're a beginner or an experienced developer, your contributions are valuable. Collaborate, learn, and make an impact in the web development community. Explore our repositories and start coding with us today!
🚀Level Up Your AI Skills with Microsoft Learn AI Skills Challenge📣
Tags: azure, microsoftcloud, learning, ai
Published: 2023-07-10 03:37:45

![PiovaMeme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brln07bvteqmqwj8ycy0.png)
Hello community!

I have some exciting news for all the AI enthusiasts out there. Have you ever found yourself learning AI on your own, feeling directionless? Or have you wished for a structured plan to guide your learning journey? If so, this is for you!

Microsoft has just launched the [Learn AI Skills Challenge](https://bit.ly/microsoftlearnAIskillChallenge)🔥. It's an incredible opportunity for anyone looking to gain and enhance their AI skills.

With exciting challenges focused on Azure Machine Learning, Azure Cognitive Services, MLOps, and AI Builder, you'll get hands-on experience with the most cutting-edge AI tools and technologies in the industry.

Best of all, upon completing each challenge, you'll receive badges and completion certificates that you can proudly display on your LinkedIn profile 🎖️📜.

So if you're a developer looking to level up your AI skills, this challenge is a great way to do so. Will you join the challenge? See you at the Learn AI Skills Challenge!