teleren/devto huggingface dataset:
DevOps with Guruu | Chapter 19 : Deploy AWS Backup for The System
Tags: webdev, aws, devops
Published: 2024-04-07 09:21:24

{% embed https://youtu.be/g0iW1OjheNQ %}
DevOps with Guruu | Chapter 19 : Deploy AWS Backup for The System

> 0:00 Result
> 1:00 Deploy infrastructure - Create S3 Bucket
> 5:30 Create Backup plan
> 9:30 Set up notifications
> 18:30 Test Restore Result
> 24:30 Clean up resources

Join me on this journey to mastering DevOps. Let's get hands-on and build a strong foundation together! Don't forget to like, share, and subscribe for more exciting content. Happy coding, future DevOps!"
Selection Sort in Java (With Intuition + Dry run + Code)
Tags: java, selectionsort, beginners, algorithms
Published: 2024-04-07 09:08:18

## Why the name **selection sort** ?

Selection sort gets its name from the way it selects the smallest (or largest, depending on the implementation) element from the unsorted portion of the array and moves it to its correct position in the sorted portion of the array. This process is repeated until all elements are sorted.


## Algorithm:

1. We start by iterating through the array from index 0 to n-1, where n is the length of the array.
2. For each iteration, we assume that the element at the current index is the smallest (min_index = i).
3. We then iterate through the rest of the array starting from i+1.
4. If we find an element smaller than the current smallest element (A[min_index]), we update min_index to the index of the new smallest element.
5. After completing the inner loop, we swap the element at index i with the smallest element found (A[min_index]).
6. This process repeats until the entire array is sorted.


I will show the working of Selection sort but make sure to dry run using pen & paper📝


![selection-sort](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uqubgiiks11af0uey4bs.jpeg)

## Code

``` java

public class SelectionSort {

	public static void main(String[] args) {
		
		int arr[] = {7, 4, 10, 8, 3, 1};
		
		int len = arr.length;
		
		int i=0, j=0;
		
		for(i=0; i<len-1; i++) {
			int min = i;
			for(j=i; j<len; j++) {
				if(arr[j]<arr[min])
					min = j;
			}
			
			int temp = arr[i];
			arr[i] = arr[min];
			arr[min] = temp;
		}
		
		
		for(int k=0; k<len; k++) {
			System.out.print(arr[k]+" ");
		}
	}

}
```


**Time Complexity:**

- Best Case: O(n^2)
- Worst Case: O(n^2)

**Space Complexity:**

O(1)

## Wrapping Up:

Now, congrats, you've learnt selection sort 🥳👏
_Thanks for reading :)
Feel free to comment and like the post if you found it helpful
Follow for more 🤝 && Happy Coding 🚀_

If you enjoy my content, support me by following me on my other socials:
https://linktr.ee/tanujav7
print(end="\n")
Published: 2024-04-07 08:52:12

Certainly! Let's break down the Python code you've provided, line by line:

```python
print(5, True, end=" | ")
```
- `print()`: This is the print function, used to output data to the screen.
- `5`: The first argument to `print()`, an integer value.
- `True`: The second argument, a boolean value.
- `end=" | "`: An optional parameter of the `print()` function that specifies what should be printed at the end of the output. By default, `print()` ends with a newline character (`\n`), but here it's been changed to print " | " instead. This means that after printing the arguments, the cursor will stay on the same line, waiting for the next print statement.

```python
print("tim")
```
- Another call to the `print()` function, this time with a single argument:
- `"tim"`: A string argument that will be printed on the screen.

When these two lines of code are executed, the output will be:
```
5 True | tim
```
The first line prints `5` and `True` separated by a space, followed by " | ", without moving to a new line. The second line then prints `"tim"` on the same line, right after the " | ".
HTML CSS and JAvascript
Tags: webdev, javascript
Published: 2024-04-07 08:48:48

What’s the hell is the feeling when starting to use html JavaScript and css. You feel like the stuff are hard to master. Of course they need time and practice but more effort is needed especially JavaScript. For html the concept is not that hard to master but once you understand the principles and what to use it for usage becomes effortlessly and when the environment used to write your theme is auto more chance that you will lear the updated version of item. First time to use css at my platform [Je-phiri](www.jephiri.com) made me look intelligent because I first practiced a lot with other guys. Indeed looking forward to see how the languages html JavaScript and css have evolved over time.
Deploy & Host a React Application on NGINX with Ubuntu
Tags: react, javascript, ubuntu, beginners
Published: 2024-04-07 08:47:59

## Prerequisites 

1. Ubuntu Machine 
2. Nginx on Ubuntu 
3. Node and NPM on local device and ubuntu 
4. Template React App 
5. GitHub

## Flow 

- Deploy Ubuntu machine on any cloud provider if you dont have setup on local device 

- On Ubuntu, run following cmd to install nginx 

- **Update package index:** Before installing any new software, it's a good practice to update the package index to ensure you're getting the latest versions. 
`sudo apt update`

- **Install Nginx:** Use apt to install Nginx. 
`sudo apt install nginx`

- **Start Nginx:** Once installed, Nginx should start automatically. If not, you can start it manually. 
`sudo systemctl start nginx`

- **Enable Nginx to start on boot:** If you want Nginx to start automatically whenever your instance is rebooted, you can enable it. 
`sudo systemctl enable nginx`


- On local device, run this cmd 

- `npx create-react-app react-app` 
**NOTE:** I have use react-app as a name of my react-app, you can keep whatever name you want 
- Push this code on github 

- On Ubuntu, run this cmd 

- `git clone https://github.com/exampleuser/example-repository.git`
**Note:** Above URL is example, you need to provide you repo URL
- npm run build
- `cd /etc/nginx/sites-available`
- `sudo vim react-app` 

Paste below code in vim editor 

```
server { 

        listen 80; 

        listen [::]:80;  

        root /var/www/react-app; 

        index index.html; 

}
```
 

- `cd /var/www/` 
- `sudo mkdir react-app` 
- `sudo chmod –R 755 /var/www/react-app` 
- `sudo chown –R www-data:www-data /var/www/react-app` 
- `cd $HOME` 
- `sudo cp -r react-app/build/* /var/www/react-app/` 
- `sudo unlink /etc/nginx/sites-enabled/default` 
- `sudo ln –s /etc/nginx/sites-available/react-app /etc/nginx/sites-enabled/`
- `sudo systemctl restart nginx` 
- `sudo nginx –t` (check the output on cmd – it should be successfull) 

Now open the Public Ip of Ubuntu machine if deployed on cloud, if launch on local open localhost:80 

_**Bye!!**_ 👋
"Page not found" on Netlify - React website deployment error solved
Tags: webdev, react, tutorial, netlify
Published: 2024-04-07 08:46:33

When deploying a React project through a build file or GitHub on Netlify. You may encounter an error when navigating and reloading different pages, as it displays "page not found." 

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

Create a new file named `_redirects` in the public directory of your React project. Open the `_redirects` file in a text editor.

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

Then copy and paste this text into the `_redirects` file. 
```
/* /index.html 200
```
After creating the `_redirects` file, rebuild the project or push the repository again.
Transforming Homes with MTC Insulation: A Comprehensive Solution
Tags: mtcinsulation
Published: 2024-04-07 08:38:38

MTC Insulation stands as a beacon of excellence in home insulation, offering a comprehensive range of services tailored to meet homeowners' diverse needs. From expert [underfloor insulation installers](https://www.mtcinsulation.co.uk/underfloor-spray-foam-insulation/) to innovative spray roof insulation solutions, MTC Insulation is dedicated to optimising comfort and energy efficiency in every corner of your home.

Expert Underfloor Insulation Installation

Underfloor insulation is crucial in maintaining optimal temperatures and energy efficiency within your home. At [MTC Insulation](https://www.mtcinsulation.co.uk/), our expert underfloor insulation installers are equipped with the knowledge and skills to ensure precise and efficient installation. Whether insulating a new build or retrofitting an existing home, our professionals conduct thorough assessments to determine the most suitable insulation materials and techniques for your needs. With MTC Insulation, you can trust that every inch of your underfloor space is adequately insulated, providing long-lasting comfort and energy savings.

Innovative Spray Roof Insulation Solutions

Spray roof insulation offers a revolutionary solution for enhancing your home's thermal performance while providing seamless coverage and superior energy efficiency. MTC Insulation harnesses the power of spray foam technology to deliver innovative spray roof insulation solutions that outperform traditional insulation methods. Our skilled technicians apply the [spray foam insulation](https://www.mtcinsulation.co.uk/underfloor-spray-foam-insulation/) directly onto the roof surface, creating a continuous barrier that seals out drafts and prevents heat loss. The result is a well-insulated roof that helps maintain consistent temperatures year-round, reducing heating and cooling costs while maximising comfort.

Conclusion: Elevate Your Home's Comfort and Efficiency with MTC Insulation

In conclusion, MTC Insulation offers a holistic approach to home insulation, with specialised services ranging from underfloor insulation installation to spray roof insulation solutions. With our team of expert installers and cutting-edge technologies, we are committed to transforming your home into a more comfortable, energy-efficient living space. Trust MTC Insulation to deliver superior results and unparalleled customer satisfaction, ensuring that your investment in insulation pays dividends for years to come.
Finding the target
Tags: perl, python, theweeklychallenge
Published: 2024-04-07 08:32:49

## Weekly Challenge 263

Each week Mohammad S. Anwar sends out [The Weekly Challenge](https://theweeklychallenge.org/), a chance for all of us to come up with solutions to two weekly tasks. My solutions are written in Python first, and then converted to Perl. It's a great way for us all to practice some coding.

[Challenge](https://theweeklychallenge.org/blog/perl-weekly-challenge-263/), [My solutions](https://github.com/manwar/perlweeklychallenge-club/tree/master/challenge-263/sgreen)

## Task 1: Target Index

### Task

You are given an array of integers, `@ints` and a target element `$k`.

Write a script to return the list of indices in the sorted array where the element is same as the given target element.

### My solution

This is a pretty straight forward task, so doesn't require much explanation. I sort the array (numerically), and then return the index of items that equally `k` in the list.

```python
def target_index(ints: list, k: int) -> list:
    ints = sorted(ints)
    return [pos for pos, value in enumerate(ints) if value == k]
```

### Examples

```bash
$ ./ch-1.py 1 5 3 2 4 2 2
(1, 2)

$ ./ch-1.py 1 2 4 3 5 6
()

$ ./ch-1.py 5 3 2 4 2 1 4
(4)
```

## Task 2: Merge Items

### Task

You are given two 2-D array of positive integers, `$items1` and `$items2` where element is pair of (item_id, item_quantity).

Write a script to return the merged items.

### My solution

My solution to this task is broken into two chunks. The first is to calculate the cumulative totals for each item. While the task mentioned `items1` and `items2` as variables, I've use the more meaningful variables `item_id` and `item_qty`.

```python
from collections import defaultdict

def merge_items(*arrays) -> list:
    # Calculate the total of each items
    totals = defaultdict(int)
    for array in arrays:
        for item in array:
            item_id, item_qty = item
            totals[item_id] += item_qty
```

The second part of the task is turning the dict (hash in Perl) into a list of `item_id` and `item_qty` pairs. This can be done in a single line with list comprehension.

```python
    return [[item, totals[item]] for item in sorted(totals)]
```

### Examples

```bash
$ ./ch-2.py "[ [1,1], [2,1], [3,2] ]" "[ [2,2], [1,3] ]"
[[1, 4], [2, 3], [3, 2]]

$ ./ch-2.py "[ [1,2], [2,3], [1,3], [3,2] ]" "[ [3,1], [1,3] ]"
[[1, 8], [2, 3], [3, 3]]

$ ./ch-2.py "[ [1,1], [2,2], [3,3] ]" "[ [2,3], [2,4] ]"
[[1, 1], [2, 9], [3, 3]]

```
Chat app illsutration
Tags: webdev, beginners, css, learning
Published: 2024-04-07 08:28:27

I've just completed a front-end coding challenge from @frontendmentor! 🎉
Chat app interface

You can see my solution here: https://www.frontendmentor.io/solutions/chat-app-using-css-grid-with-bonus-initial-animation-on-page-load-4rfseBpkNn

Any suggestions on how I can improve are welcome!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/69jntczhhb93fum436q1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a47xq6htpemyeemg93kc.png)
Simplifying Markdown: A Beginner's Guide to Easy Writing
Tags: opensource, writing
Published: 2024-04-07 08:23:51

## Introduction:
Markdown has become popular due to its simplicity and widespread acceptance across different platforms. It allows you to write content in plain text, making it perfect for tasks like creating blog posts.

**What is Markdown?**
Markdown is a markup language, similar to HTML, used to format text into a specific structure. It's like a tool that converts plain text into a readable format, making it easy for developers to control the appearance of their text and code.

In this guide, we'll cover the basics of Markdown, including creating your first Markdown file, creating a Markdown cheat sheet, understanding how Markdown works in VS Code, and exploring tools that support Markdown.



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

**Tools that Support Markdown:**
Several tools enhance productivity when working with Markdown such as 

1. VS Code
2. Atom
3. Sublime Text
4. Markpad


These tools provide real-time views of Markdown and rich text, making writing and editing easier.

## How to Work with Markdown:
Download and enable the Markdown plugin in VS Code to start working with Markdown files. VS Code is a versatile text editor that supports various programming languages, making it ideal for writing and rendering Markdown files.

**Creating Your First Markdown File:**
Save your text file with a .md extension to start using Markdown syntax.


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

Use specific Markdown syntax for headings, bold text, italics, lists, code blocks, and more, as shown in the table below:

| Task           | Markdown Syntax       |
|----------------|-----------------------|
| Heading 1      | #                     |
| Heading 2      | ##                    |
| Heading 3      | ###                   |
| Italics        | *italics*             |
| Bold           | **Bold**              |
| Strike         |   ~~ insert text ~~   |
| Block quote    | >                     |
| Unordered list | * List item           |

**Writing Code Blocks in Markdown:**
VS Code supports coding in different languages within Markdown files. Use language-specific syntax to create code blocks for languages like HTML, Bash, Python, and JavaScript.

Escape Characters in Markdown:
Use the backslash (\) to escape characters in Markdown and retain their original appearance, especially when dealing with special Markdown syntax.

Practical Applications of Markdown:
Markdown is useful for email templates and technical documentation. Platforms like GitHub use Markdown extensively in README.md files, combining code blocks with well-formatted text for clear communication.

By following these simple guidelines, you can master Markdown and enhance your writing and formatting skills effortlessly. Happy Markdown writing!
Follow for awesome content! 🚀 Don't miss out! Hit that Like ❤️ button!
How to write polyfill for map
Tags: webdev, mappolyfill, javascript, arraymethods
Published: 2024-04-07 08:20:14

Polyfill for map function in JavaScript

JavaScript's map function is widely used for iterating over arrays and applying a transformation to each element. However, if you're working with older browsers or environments that don't support map, you can create your own polyfill.

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


Step 1: **It is a function** : create a normal function with the name 'myMap' as below
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/81paz6sawgpeofiwum6e.png)

Step 2: This function takes callback function 'callback' as parameter

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

Step3: array.map() doesn't affect original array. So create a new array 'output' and  return the newly created array.

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


Step 4: Map operates on each element of the array. So loop through each element using for loop


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


Step 5: When each element of original array is mapped,push the modified value into 'output' array to return it.


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

Step 5: The callback function acts on each value of the passed array(this)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zanwvd5hteklzhz7wyai.png)
The convenience and versatility of local car rentals
Published: 2024-04-07 07:59:47

The world is spinning faster than ever, and as we hustle to keep up with the pace, mobility becomes a paramount concern. From errands to business trips to weekend getaways, our need for reliable transportation is evident in all facets of life. Here's where local car rentals come into play. These services offer an unmatched blend of convenience, flexibility, and options to meet our diverse transportation needs. Let's delve deeper into how choosing a [car rental near me can](https://urlgeni.us/google_places/Car-Rental-Pearson-Airport-Car-Rental-Agency-Toronto-ON) influence your travel plans.

Local Car Rentals – A Doorstep Convenience
With the rise in convenient service delivery models, people are leaning more towards options that provide doorstep amenities while minimizing unnecessary commutes. Renting a car from a neighborhood rental agency brings this luxury at an easy reach. Clients can take their pick from the range of available vehicles and cruise off into their schedules without prolonged waits or commute hassles.

Options Galore – Catering to Diverse Needs
One inherent advantage of local car rentals is the versatility they offer in terms of vehicle choices. Whether you're seeking a sleek sedan for a business trip or an SUV for a family road trip, renting locally ensures you get the best match for your specific need—no compromising on passenger space or luggage capacity!

Enhance Your Journey’s Experience
Opting for local car rentals allows you to tailor your journey according to your preferences entirely. From choosing climate-friendly hybrids ensuring fuel efficiency to luxury cars enhancing style quotient – access to different classes of wheels lets plan your trip just the way you want it!

The Flexibility that Favors You 
One unparallel advantage local car rental near me offers is immense flexibility. Need wheels for just one part of your journey? Prefer driving during day hours but not post-dusk? Only have usage for short? Car renters can enjoy the freedom of tailor-making their leasing terms with rentals—talk about making your journeys stress-free!

Cost-Effectiveness 
Owning a car certainly comes with ongoing costs. Car insurance, regular maintenance, or unexpected repairs to name just a few. Local car rentals eliminate these concerns and provide customers with well-maintained, reliable vehicles for their use without the overheads associated with ownership. 

In conclusion, turning to local car rental options simply makes sense in today's fast-paced world, where convenience sits at a premium. Not only do you get freedom from the engagements of owning a vehicle, but it also lets you enjoy flexibility, choice variety, cost-effectiveness, and overall a superior experience—no matter whether your journey is business-oriented or leisurely escapade.


[City Car & Truck Rental](https://citycarandtruckrental.com/)
445 Rexdale Blvd, Etobicoke, Ontario, M9W 6P8, Canada
416-800-1222
Konklusion på fordelene ved elbil
Tags: tesla, elbiler, ai, youtubesummerizer
Published: 2024-04-07 07:47:19

En opsummering af indhold i denne video: [222.000 km i Tesla Model 3 Long Range: Se Franks regnskab for elbilen | bilguiden](https://www.youtube.com/watch?v=P2l14cqJ9iQ) lavet ved hjælp af GPT [YouTube∑✏️ - YouTube Summarize](https://chat.openai.com/g/g-GvcYCKPIH-youtube).

---

> Elbiler kan tilbyde betydelige økonomiske besparelser og miljøfordele i form af lavere driftsomkostninger og reduktion i CO2-udslip. Selvom der kan være udfordringer med værditab og tilgængelighed af opladningsmuligheder, er elbiler generelt en fordelagtig investering for mange bilkøbere.

Elbiler frembyder ikke kun en mere miljøvenlig løsning, men tilbyder også lavere løbende omkostninger sammenlignet med konventionelle benzin- eller dieselbiler. Denne type køretøj kræver færre mekaniske reparationer på grund af færre bevægelige dele, hvilket bidrager til den samlede økonomiske fordel ved at eje en elbil.

### Fordele:
- **Økonomiske besparelser:** Lavere omkostninger til brændstof og vedligehold.
- **Miljøvenlig:** Reducerer CO2-udslip og forurening.
- **Mindre vedligeholdelse:** Færre bevægelige dele reducerer behovet for hyppige reparationer.

### Udfordringer:
- **Værditab:** Elbiler kan opleve et hurtigere værditab end traditionelle biler.
- **Opladningsinfrastruktur:** Tilgængelighed af ladestationer kan være begrænset afhængigt af geografisk placering.
Fashion style
Tags: fashion, style, fash, fastapi
Published: 2024-04-07 07:43:54

https://fashionstyle670.blogspot.com/2024/04/eco-stylish-supportable-style-becoming.html

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