teleren/devto huggingface dataset:
W3Schools Strings Method With Example
Tags: javascript, strings, code, example
Published: 2022-08-18 05:38:00

Here are Strings Method that I learned on W3schools 
you can copy paste it and check the output and experiment with it
 

```
/*
IN JAVASCRIPT
strings are primitve values and they dont have mehthod or properties
BUT
JS consider stings as objects so  we can use mehthod and properties with Srings


*/

let text = "Hello World Hello";

//returns the lenght of the text
console.log(text.length);

//extracting the strings from inde
console.log(text.slice(2,5));

//extracting the string if its negative then starts from back
console.log(text.slice(-1,));

//extractin the string : (from, no of amount to extract);
console.log(text.substr(2, 6));

//replace the specific World
console.log(text.replace("Hello","Bye"));
/*
if we have text as >>>>> "Hellow my world you are hello"
:  text.replace("Hello","bye"); >> will replace only 1st hello
: to replace all 'Hello' we use : text.replace("/Hello/g","bye");

*/

console.log(text.replace("/Hello/g","bye"));
// or we can use

console.log(text.replaceAll("Hellow", "bye"));

//to upper case
console.log(text.toUpperCase());

// to lower case
console.log(text.toLowerCase());

// now its time to trim so
console.log("TRIMMING  " +  text.trim());

// adding some before num
//if its nume first we need to convet it into strings
let padnum = "hey bitch";
let convert = padnum.toString();
let padstart = convert.padStart(10,"o");
console.log(padstart);

//SAme you can do with pad end
var name = "bhag";
let outputofname = name.padEnd(50," bhai ");
console.log(outputofname);

//Extracting String Character at specific position
console.log(text.charAt(9));

//Extracting String Character code at specific position
console.log(text.charCodeAt(9));

// you can also do this
console.log(text[9]);

//Converting String to arrays 
var convertedtoarray = text.split(" ");
console.log(convertedtoarray[2]);
```
10 Resources to BRUSH uP DSA concepts !
Tags: coding, datastructures, algorithms, beginners
Published: 2022-08-18 05:36:00

If you are not quite ready to jump into problem solving. I have made this concept review thread (originally on [twitter](https://twitter.com/keshavgbpecdel/status/1560116226226982912)) to brush up your concepts of data structures and algorithms 🔥

1. Crash Course on Data Structures by Mosh Hamedani
https://www.youtube.com/watch?v=BBpAmxU_NQo



2. 10 Most Important Concepts for Coding Interviews by Clement Mihailescu
https://www.youtube.com/watch?v=Ge0Udbws1kc



3. Linked List Review by HackerRank
https://www.youtube.com/watch?v=njTh_OwMljA



4. BFS and DFS Review by HackerRank
https://www.youtube.com/watch?v=zaBhtODEL0w



5. Binary Search Review by HackerRank
https://www.youtube.com/watch?v=P3YID7liBug



6. Stacks and Queues Review by HackerRank
https://www.youtube.com/watch?v=wjI1WNcIntg



7. Trees Review by HackerRank
https://www.youtube.com/watch?v=oSWTXtMglKE



8. Heaps Review by HackerRank
https://www.youtube.com/watch?v=t0Cq6tVNRBA



9.Hash Table Review by HackerRank
https://www.youtube.com/watch?v=shs0KM3wKv8


10.Recursion Review by HackerRank
https://www.youtube.com/watch?v=KEEKn7Me-ms


Follow @keshavgbpecdel for more such helpful content!
SSH into Ubuntu WSL in Windows
Tags: windows, wsl
Published: 2022-08-18 05:30:10

## Overview 

I love to work in linux, however there are times when I need to sneak into Windows for whatever reason. The thing is I work much faster in linux terminal and want to utilize WSL. Some articles I've found has rather complicated steps.
So here is simple steps to get you on your way.

## Requirements 

- Windows with WSL installed. You may pick whatever distro you wish.
- SSH server in your linux box.

## Steps 

### Enable SSH server on linux box.

This step is may differ for each distro. Below is for debian based:

``` bash
sudo systemctl  ssh start 
```

### Create tunnel from Ubuntu WSL into Linux host 

``` bash
ssh -R 2000:localhost:22 <your-linux-username>@<your-linux-host>
```

### [Optional] Copy public key to linux host

This will allow to do passwordless login. If you haven't create ssh key in your WSL, do the following:

- ssh-keygen -t rsa
- Copy the content of ~/.ssh/id-rsa.pub to ~/.ssh/authorized_keys file in your linux host

## Drawback 

This method require you to manually start tunnel from your Windows bash.

## Summary

Ok, Thats all. Just couple few steps to get you SSH into your Windows box. You can also extend this to allow it to be accessible from the internet.
I hope you find this usefull.
Hi, I'M BRINGING MY IDEA TO LIFE
Tags: programming, devops, reactnative, design
Published: 2022-08-18 00:22:47

Hi friend,
hope you are good? I meant that question. This blog and writeups are just a way of sharing what i feel and giving people the opportunity to know me through my pen.
  So dear friend i haven't said this here or anywhere before but this is the reality. 
Earlier this year i had an idea in the middle of the night, it's definitely not a dream because i don't believe in that or i don't just have them, but something happened and i completely blanked on the idea. shame on me!
But then crazily in may it came back at night too butt this time it was different cos i quickly pickup my pen, Jot things down and started analyzing all possibilities and what not. 
  I gathered my team And the building started. i thought i wouldn't write a code but maybe nature is in support of me writing codes, currently we're building with React Native and Firebase, i'm in charge of the product frontend, designs and relations. i really do love a good cause.  
And the day before yesterday we launched our waitlist [website](https://xlistics.com)to keep us the developers and other part of the team on our toe and since the launch we've gathered 100s of entries on our waitlist data and i must say the feeling is **ectatic.**    

  `~with love iJ03L.
Tips To Help You Become A Better Developer
Tags: webdev, programming, beginners, javascript
Published: 2022-08-18 05:07:00

1. Don't try to program for the sake of programming. Instead, come up with an actual problem you want to solve. Having a problem to solve will immediately give you structure. Do your best to attempt to solve the problem on your own, if you can't accomplish it, then go to the internet and ask for help!

2. Solve more problems.

3. Really, you can only improve your problem solving skills by solving problems. The more you do, the better.
4. Maybe, "Think Like A Programmer" and/or "The Pragmatic Programmer" can help.

5. I often hear "it's better to do than to read," but I honestly don't think you can substitute one for the other. You really need to do both, since many of the most important concepts can only be understood by reflecting on the studies and experiences of experts. So to me it's sort of a no-brainer: you should be reading if you can't get on your laptop.

6. Practice. Specifically, deliberate practice.

7. Personally I'd learn the basics of syntax by just googling some sort of java tutorial. Then move to recoding your own projects into java for practice. Meanwhile ask your company what frameworks and tools they use and start studying up on that, like Spring is a popular web application framework, but don’t know if they use that at least you have a job and should be able to figure out what exactly you need to be comfortable with.

8. Have you considered asking yourself whether you want to be a maker or a programmer? a maker often needs to program, but a programmer doesn't always want to be a maker?That slight shift in your lens may help clarify how you go about looking for software projects?First make it work, then make it right, then make it fast. In that order. Don't be afraid to throw away code.


9. Github has a lot of code you can draw inspiration from. Use it's search functionality, you will like it.You don't have to share your code. Github permits private repositories for free. Also you don't even have to create a Github account to search and clone public repositories.learning Git is a good skill to have. You don't need to master it all. Learn the basic philosophy and create/find a cheat sheet with the basic commands and you will be set. You don't have to know git to use most of Github's interface.


10. You need to throw yourself into something, even if it is "simple".

11. I would pick a language that is Type Safe: C#, Java, C/C++, etc. Make something like Tic Tac Toe in command-line, maybe port it over to a windows form GUI in C# using visual studio (not visual studio code). This will fortify your knowledge of basic types, learn how to find documentation about built-in functions and member data, and perhaps give you a flow of how you go from nothing to a working tic tac toe game. After that maybe try to think about things you enjoy or basic projects.

12.W3Schools Online Web Tutorials is a great resource. Programming can certainly be self taught.

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/channel/UCze04H5oeudQ01G9DDj-frA)
Attaching Volume to a Linux Instance (EC2) cmd
Tags: aws, storage, linux, ebs
Published: 2022-08-18 05:02:00




1-lsblk ( List Block )
This command lists information regarding all available block devices attached to an instance and it does that by reading sysfs filesystem


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

2- file -s 
This is used to check if a volume has file system. This command gather information about a specific device such as system type.When the ouput shows "data", this means the device has no file system on the device. 


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

3- mkfs ( Make File System)
 This command is used to create file in linux. when combined with -t=type (mkfs-t), it specified the file type 



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2nq5y3nkga0ick7usl5d.JPG)

4-mount
 This command is used to attaches the file system to a volume to the file tree. It is used to mount the volume at the directory created using the mkdir command.
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzc5ncd1bqah73ktkcwc.JPG)

5-/etc/fstab
This command is used to automatically mount a volume after reboot.

To mount an attached EBS volume on every system reboot, add an entry for the device to the /etc/fstab file. You can use the device name, such as /dev/xvdf, but using the device's 128-bit universally unique identifier (UUID) is the recommended method. You can open and edit the /etc/fstab using an editor such as nano or vim.

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

6- blkid (block ID)

The blkid (block ID) command identifies the 128-bit universally unique identifier (UUID) of the device. 
Use the blkid command to identify the UUID, and make a note of the UUID of the device that you want to mount after reboot. Then add the UUID to the /etc/fstab file. (See the following item for for an explanation of the /etc/fstab file.)

Device names can change, but the UUID persists throughout the life of the partition. By using the UUID, you reduce the chances that the system becomes unbootable after a hardware reconfiguration. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dx4yqg8l1udfag9mu3gb.JPG)
Perbandingan backup dan restore database MariaDB menggunakan mysqldump,mydumper, mysql dan myloader
Tags: mysql, mydumper, myloader
Published: 2022-08-18 04:52:00

# Backup menggunakan mydumper
```
time mydumper -h ip_address -u nama_usernya -p passwordnya --database nama_databasenya --outputdir nama_foldernya --logfile alamat_logfilenya.log
0.46s user 0.17s system 17% cpu 3.542 total
```

# Backup menggunakan mysqldump
```
time mysqldump -h ip_address -u nama_usernya --databases nama_databasenya -p > nama_backup_file.sql
Enter password: 
0.38s user 0.13s system 7% cpu 7.241 total
```

# Restore menggunakan myloader
```
time myloader -u nama_usernya -p passwordnya --database=nama_databasenya --directory=nama_folder_hasil_export_dari_mydumper    
0.04s user 0.06s system 7% cpu 1.467 total
```

# Restore menggunakan mysql
```
time mysql -u nama_usernya -p < nama_backup_file.sql
0.29s user 0.04s system 5% cpu 6.398 total
```

Dari percobaan di atas, didapat hasil backup menggunakan mydumper lebih cepat begitu juga restore menggunakan mysql
What is Multi-Paxos?
Tags: algorithms, distributedsystems
Published: 2022-08-18 04:47:00

## Introduction

In my last article, I wrote about Paxos [(What is Paxos?)](https://dev.to/skoya76/what-is-paxos-1152). Paxos could only determine a single value. Nothing more, nothing less. 

## [SMR](https://dev.to/skoya76/state-machine-replication-196n) and [Total Order Broadcast](https://dev.to/skoya76/total-order-broadcast-5ccl)

SMR (State machine replication) is a method of achieving fault-tolerant service by replicating servers and having those servers cooperate. All replicated servers (replicas) have exact copies. This allows for improved availability by allowing a replacement replica to provide service in the event of a failure of one of the replicas.

However, all replicas must apply the operations in the same order to operate to keep the replicas in the same state as each other. To accomplish this, total order broadcast is used. And Multi-Paxos, which we will discuss in this article, is used for all-order broadcasts.

## Multi-Paxos 
As mentioned above, Multi-Paxos wants to agree on the order of execution of instructions. The figure below shows an illustration of Paxos and Multi-Paxos.
![Paxos and Multi-Paxos](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/87wowtv6f916ykct8ycp.png)

The Paxos figure depicts a single value being determined by all participants. The Multi-Paxos figure depicts a blue replica as the leader, and multiple values are determined by consensus. The leader serializes the execution of each Paxos.

To accomplish this, include the proposal number used by Paxos and the i in the index number of the i-th order in the message to be transacted in each request.

## Comment
Leader changes and other detailed specifications are in [this paper](https://dl.acm.org/doi/10.1145/2673577).

Thanks for reading to the end!
Converting an Internship to PPO or a full-time opportunity. 💼🏢
Tags: career, job, internships
Published: 2022-08-18 04:35:22

1️⃣ Understand what the company and manager expect from you. Be present in the conversations with your team and figure out ways in which your work can help towards solving the problem or executing an idea that your manager plans to implement. Contribute your own ideas as well.

2️⃣ Offer to help your teammates beyond your work scope as well. If you want to have long-term relationships with anyone in your life, you must go the extra mile, the same applies at your workplace. And of course, do ask for help when you need it.

3️⃣ Say "Yes" more than "No". There will be various situations where you might be compelled to say "No" but make sure you offer an alternative "Yes" statement and a genuine reason why you cannot do a certain task that is assigned to you. An 80:20 ratio is good towards Yes: No

4️⃣ Don't be afraid to make risky decisions. All your decisions might not be correct and it might influence you into overthinking the impact of it on your company. But focus on the learning part more. Also, consider taking advice from your teammates and managers in the decision.

5️⃣ Pay attention to your 1:1 (s) with your managers. Listen to the feedback carefully, and make notes about your strengths and weaknesses. If no weakness is pointed out, ask them yourself. It not only helps you improve but also lets your bosses know that you are willing to learn.

6️⃣ Avoid worrying too much about the payscale vs the work you are doing. If you are capable and hardworking enough, the management will take care of the rest. Just be consistent and responsible towards the tasks assigned. The money and promotion will follow.

7️⃣ Network and collaborate outside your department as well. Build meaningful relationships with people across teams. It will help you gain visibility and institutional knowledge. But, avoid getting involved in office politics and gossip while you do so.

8️⃣ Try to attend the happy hour sessions or other fun activities conducted for the employees. It helps in building connections with colleagues from other departments and also lets your HR know that you are taking part in stuff outside your work as well.

9️⃣Always stay close to your immediate senior coworker. Make sure to accompany them in the meetings they attend or events they go to. You will learn a lot from the way they work and their daily routine. It will also prepare you for your future full-time opportunity.
Introducing : Pie Chart Maker
Tags: javascript, webdev, react, nextjs
Published: 2022-08-18 04:23:24

Hello everyone 🖐, Hope you all are doing well, Atharv here, a frontend developer passionate about building side projects.  I'm so excited to share my next side product, Pie Chart Maker with you all.

[Try Pie chart maker](https://piechartmaker.co/)

## ✨️Inspiration

Pie charts are one of the most popular graphs used in reports and presenstations. Pie charts are often used in business. So I started thinking of building a web app for the same, with more additional features.

## Introducing Pie chart maker

Pie chart maker is a free online tool using which you can make visually pleasing and beautiful pie charts. You can download the pie charts as a png/jpg image or as an svg file.

With Pie chart maker, you can make beautiful and visually satisfying pie charts with just few clicks. It is really easy to use. You don’t have to deal with traditional complex applications anymore. Simply enter the data and your pie chart will be ready. You can configure the other options according to your need.

## Features of Pie chart maker 😍

**Change background color**

You can change the background color of pie charts according to your choice. Select the color picker and take the color as you need. The changes in color automatically get reflected in preview given below.


![background color change](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/icfgqf1advuhxdsiebye.gif)

**Make 3D**

You can make a 3 dimentional pie charts with just one click. There is no extra configuration needed. There is a toggle button for making a 3D pie chart.


![Make 3D pie chart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bc2vkvhz8cqrk41106no.gif)

**Change position of legend**

You can change the postion of legend according to your need. There are various options for legend position such as top, bottom, left and right. There is default option for labeled legend.


![change legend position](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/11u8r8kwkbdj8pzso1rs.gif)

**Make Doughnut chart**

You can make a doughnut chart with just one click. All you need to do is to change the size of pie hole accordingly. 0.4 pie hole size suits best.


![make doughnut chart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijwleemcs2q0c7kfho3o.gif)

**Download graph**

You can download the pie chart for your use in three different formats such as .png, .jpg or .svg. 

**👩‍💻 Built with**


- `Next.js` : For building the whole UI
- `Tailwind CSS` : For complete styling
- `Vercel` : For frontend hosting
- `react-icons` : For icons

**🤗 Final words.**

Hope you enjoyed [Pie chart maker](https://piechartmaker.co/), Don't forget to bookmark the website, it will be very useful. 
Share it with your friends and let them know about Pie chart maker, Looking forward to your feedback and suggestions. Feel free to share your thoughts and feedback. and help it make even better and super handy.
Building Netflix Clone in React
Tags: javascript, react, webdev, showdev
Published: 2022-08-18 04:08:59

I tried To build Netflix clone Using ReactJS. Please Rate it so that I can improve :) Thank You.

⭐ Contributions are welcomed!

[Live](https://netflix-clone-06.netlify.app/)

* Note: 
   - I have used TMDB Api. 
   

[github](https://github.com/Yashkapure06/netflix-clone)


Give a ⭐ if you like it :)

![Netflix Clone using React Js - Check on github](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm6ltvj3du3jksmwmwlr.png)
Useful Scala Code Snippets
Tags: scala, codes
Published: 2022-08-18 04:00:56

Scala is a strong statically typed general-purpose programming language which supports both object-oriented programming and functional programming.
In this article, I am writing some of the code snippets, which are useful in Scala programming language.

**Swap two numbers without using third variable**

```
num1 = num1 + num2
num2 = num1 - num2
num1 = num1 - num2
```

**How to get the full month name?**

```
val cal = Calendar.getInstance
val monthName = cal.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.getDefault)
println(monthName)
```
**How to append varargs parameters to an ArrayBuffer?**

```
val arrBuf = ArrayBuffer[String]()

// Adding one element
arrBuf += "New Delhi"

// Creating a method with a varargs parameter
def appendMultipleVarArgs(strings: ArrayBuffer[String], varArguments: String*): Unit = 
    arrBuf.appendAll(varArguments)

// Adding multiple varargs parameters
appendMultipleVarArgs(arrBuf, "Mumbai", "Bhopal")

// Printing elements
println(arrBuf)
```

**Script to convert strings to uppercase using object**

```
object ConvertUpper {
 def upperfun(strings: String*) = strings.map(_.toUpperCase())
}
println(ConvertUpper.upperfun("Hello", "Hello, world!", "How are you?", "Bye!"))
```
**How to transform an array to a string using mkString?**

```
val arr = Array(10,20,30)

var result = arr.mkString
println(result)

result = arr.mkString(",")
println(result)

result = arr.mkString(" ")
println(result)

result = arr.mkString("(", ",", ")")
println(result)
```

Reference: [100+ Scala Code Examples](https://www.includehelp.com/code-examples/scala.aspx?ref=devto)