teleren/devto huggingface dataset:
Part 3:- Try Catch javascript Syntax
Tags: webdev, javascript, coding, beginners
Published: 2022-11-24 16:09:38

## Javascript Code

``` javascript
const btn = document.getElementById("btn");
const divdata = document.getElementById("divdata");

//Work with remote api
// Promise then | Single Data
// const makeRequest = async() => {
//     console.log(1)
//     fetch("http://127.0.0.1:8000/student/")
//     .then((res) => {
//         if (!res.ok){
//             console.log(res.statusText);
//         }
//         return res.json();
//     }).then((data) => {
//         console.log(data);
//     }).catch((err) => {
//         console.log(err)
//     })
// }

// Async & Await 
// const makeRequest = async () => {
//     try {
//         const res = await fetch("http://127.0.0.1:8000/student/");
//         if (!res.ok) {
//             throw new Error(res.statusText)
//         }
//         const data = await res.json();
//         console.log(data);
//         data.forEach((item) => {
//             divdata.innerHTML += `${item.title} - ${item.desc} <hr>`
//         })
//     } catch (error) {
//         console.log('error', error);
//     }
// }


// Promise Then | POST REQUEST
// const makeRequest = () => {
//     const init = {
//         method: "POST",
//         headers: {
//             'Content-Type': 'application/json'
//         },
//         body: '{"title": 10, "desc": 10}'
//     }
//     fetch("http://127.0.0.1:8000/student/", init)
//         .then((res) => {
//             if (!res.ok) {
//                 console.log(res.statusText);
//             }
//             console.log("res", res);
//             return res.json();
//         }).then((data) => {
//             console.log(data);
//         }).catch((err) => {
//             console.log("error", err);
//         });
// }

const makeRequest = async () => {
    try {
        const init = {
            "method": "PUT",
            "headers": {
                "Content-Type": "application/json"
            },
            "body": '{"title": 100, "desc": 100}'
        }
        const res = await fetch("http://127.0.0.1:8000/student/630e306ba6306216f4fde80a", init);
        if (!res.ok) {
            throw new Error(res.statusText);
        }
        const data = await res.json();
        console.log(data);
    } catch (error) {
        console.log("error", error);
    }
}

btn.addEventListener('click', makeRequest);
```


Thank You.
You can follow us on:
[Youtube ](https://www.youtube.com/c/ULTIMATEPROGRAMMING)
[Instagram](https://www.instagram.com/full_stack_web_developer1/)
The Tide of Tech
Tags: webdev, beginners, productivity, opensource
Published: 2022-11-24 16:08:18

The plight of the frontend dev, notwithstanding the shifting seas of technologies we acquaint ourselves with, is one of perseverance, discipline, but most of all... collaboration. It takes a team to create something great. For in this lonely profession, there exists in every developer the yearning for human connection. The cold keys we so often find ourselves in front of are often unforgiving in their criticism of our work: the constant error handling, the writing & re-writing of code that didn't satisfy marketing, or the looming sense of imposter syndrome that plunges us all into darkness and doubt. 

It is the team, at first, that provides us with the affirmations we need to soldier on. But as time progresses, there comes a point when every dev will need to discover their own self-worth and root themselves in it. Thus, we manifest a new perspective of our potential, a way of breaking through the impending cloudfront that darkens our desks and monitors. The power of this newfound belief is limitless in its capacity to change the way we see our code, our careers, and more importantly our place in the future of this industry. For we must learn to flow with the tide of tech.

Eat well, rest deeply, and happy thanksgiving! 

- Tristan
The new beggining
Tags: beginners, javascript, webdev, programming
Published: 2022-11-24 16:05:55

And so, the decision was made. It wasn't an easy one, it didn't come fast and it’s still surrounded by thousand different doubts every day. 
After the majority of my adult life spent on developing as  an architect I decided to switch into tech. The disappointment concerning the architectural market was bubbling for years and it finally reached its limit. 

I am very new here, just scratching the surface for now, trying to manage the fear and keep my discipline and determination up! Hoping that maybe someone someday can benefit from the story of my journey. 

It’s gonna be the first time I say this, so it deserves a little celebration:

	**Happy coding!**
Part 2:- Try Catch javascript Syntax
Tags: javascript, coding, webdev, beginners
Published: 2022-11-24 16:05:20

## Javascript Code

``` javascript
let btn = document.getElementById("btn");
let divdata = document.getElementById("divdata");

//Working with Json file
function makeRequest() {
    fetch('data.json')
        .then(async (res) => {
            if (!res.ok) {
                throw new Error(res.statusText)
            }
            console.log('res', res);
            const dt = await res.json()
            console.log('res.json()', await res.json());
            return dt;
        })
        .then((data) => {
            console.log(data);
            // divdata.innerHTML = data;
        })
}

//Showing Data into Browser
function makeRequest() {
    fetch('data.json')
        .then((res) => {
            if (!res.ok) {
                throw new Error(res.statusText)
            }
            return res.json();
        })
        .then((data) => {
            console.log(data);
            divdata.innerText = data.name;
            divdata.innerText += data.id;
        })
}

// Async & Await 
async function makeRequest() {
    try {
        const res = await fetch('data1.json');
        if (!res.ok){
            throw new Error("sab moh maya hai");
        }
        const data = await res.json()
        console.log(data);
        divdata.innerHTML = data.name;
    } catch (error) {
        console.log('error', error);
    }
}



btn.addEventListener('click', makeRequest); 
```

Thank You.
You can follow us on:
[Youtube ](https://www.youtube.com/c/ULTIMATEPROGRAMMING)
[Instagram](https://www.instagram.com/full_stack_web_developer1/)
Big Thanks to All Our Mods! 🙌
Tags: meta, thanksgiving, moderation, community
Published: 2022-11-24 16:02:04

Heyo folks!

It's US Thanksgiving today and a company holiday here at Forem (the folks behind DEV & [CodeNewbie](https://community.codenewbie.org/)). Much of the team is off for the day, but I'm online for just a couple hours to check our [abuse reports](https://dev.to/report-abuse), banish the spammers 😈, and offer support to those who need it.

Luckily, I have lotsa help! Our [Trusted Users](https://dev.to/community-moderation), [Tag Moderators](https://dev.to/tag-moderation), and various community members all help to report spam, abusive behavior, and plagiarism. Our moderators (trusted users and tag mods) assist me (and my partner in ~~crime~~ good vibes, @caroline 🙌) on a daily basis by reporting [Code of Conduct](https://dev.to/code-of-conduct)-violating behavior, downvoting low quality content, and correcting tags on posts as needed so that the site is better organized for everybody.

As I sift through the pile of reports this morning, I'm seeing so many familiar usernames and reminded how generous our mods are to dedicate their time toward making DEV a kind, safe, inclusive, organized, and as-spam-free-as-can-be place. Our mods do this work purely out of love for DEV — there is no pay and not a heckuva lotta recognition either. Rather, these unsung heroes act mostly behind-the-scenes, motivated by good intentions and a desire to foster a positive, helpful community that we can all enjoy and benefit from. 💚

I cannot say enough how grateful I feel for our moderator team! So instead, here's a collection of awkward "thank you" GIFs to show my appreciation. 

![Tom Hanks waving, the words "T. Hanks" appear on the screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qe0i4xhs68c1s9qt4yat.gif)

![Kazoo kid saying "I just wanted to say thanks, partner"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5rcsacdevxg3d8ivcuv1.gif)

![Thank ewe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8kb3lh9nqdunv3zo93kl.gif)

![Person with a bunch of bananas on their head saying "Thanks a bunch"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a5unpt92uedktvq7dkbr.gif)

![Dog floating in space with the word "thanks" on screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d8h0r8no2p6v3gvhncft.gif)

If you wanna say thanks but don't know how, feel free to [grab a thankful GIF](https://giphy.com/search/thanks) and drop it in the comments.
Can "Don't reinvent the wheel" be bad advice?
Tags: webdev, beginners, programming
Published: 2022-11-24 15:59:37

A very common programming tip is "Don't reinvent the wheel". If there's already a library that already does the task you need, why don't you just use that library instead of writing your own solution?

Many times, it's a sensitive thing to do: importing third-party libraries lets you focus on other tasks. Also, if you're using a popular library that has been stable for years, it probably does the task better than you! However, using third-party components have drawbacks.

The authors might deprecate the library or even delete it. Or the library (or any of their dependencies) might have a security problem and you have to wait until the authors fix it. Or they might even decide not to fix the security issue.

In 2016, there was an NPM JS package called "left-pad", which was used as a dependency for thousands of projects. [One day, the original author deleted it and broke every single project that depended on it](https://www.theregister.com/2016/03/23/npm_left_pad_chaos/).

Another drawback may happen when your project changes after you used an external library. You may need to add new functionality that doesn't work with the library you added. Generally, this kind of problem can be solved, but it adds complexity to your project.

I think "don't reinvent the wheel" is a good approach, but you have to be careful every time you add an external library to your project:

 * If the library you're adding is very big and you need a small part of it: it's probably a better idea to do it yourself or look for a smaller library.
 * If the library has been popular for a long time, that's good. If you run into problems, you'll have a lot of documentation and help online.
 * If the task is small or simple, it's a better idea to implement it yourself.
 * If the task is very complex, looking for a library might be a good thing to do.
 * **If you have to do tasks involving security (cryptography, passwords, hashes, etc) it's very recommended to use a trustworthy, third-party library.** Cyber security is a very complex field, if you try to create your own security-related tasks, it **will** be insecure.

To sum up: can "don't reinvent the wheel" be bad advice? The answer, as always, is: "it depends".

---

If you liked this article, you'll love my JavaScript Newsletter.
Every other Monday, I'll send you easy and actionable steps to level up your JavaScript skills. Check it out: https://nicozerpa.com/newsletter
storage devices hierarchy
Tags: database, computerscience
Published: 2022-11-24 15:43:55


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

[source](https://www.cs.csustan.edu/~john/classes/previous_semesters/cs3750_operatingsys_i/2019_02_Spr/Notes/Chap01/01_Introduction.html)
Guess the logo : #3
Tags: logo, webdev, opensource, programming
Published: 2022-11-24 14:57:03

Hey hey.. 🙌

Welcome to yet another episode of "Guess The Logo" series. 💻

You can guess the logo related to programming, for each logo, there will be 3 sec time ⏱️ to guess.

Ready for comment ✍️ the correct guess count.

{% embed https://youtu.be/fWXU_1oOyAI %}
Learn How To Install LAMP Stack, Apache, MySQL, PHP PhpMyadmin On Ubuntu 16.04 Or 18.04
Tags: lamp, apache, php, phpmyadmin
Published: 2022-11-24 14:48:36

This is part 1 of the blog series to learn how to create free website or blog. All the steps one have to follow step by step of to create a website. Read, follow, run all instructions and commands.

**[Read More](https://www.ivylearnings.com/learn-how-to-install-lamp-stack-apache-mysql-php-phpmyadmin-on-ubuntu/)**
Can you select the element?
Published: 2022-11-24 14:45:07

Can you select the element on this page by ID?

https://testpages.herokuapp.com/styled/challenges/hard-selectors.html

Try and solve the challenge then comment how you did it?
What strategy did you use?
What steps where taken?

If you could not find the solution see the video below

https://www.youtube.com/watch?v=yXFV--BHJnQ&feature=youtu.be&ab_channel=ResterTest
Data Science Best Learning Roadmap
Tags: datascience, machinelearning, python
Published: 2022-11-24 14:40:51

Data Science Learning Roadmaps
#ML #DataScience #python
When we are start learning data science we some times get confused where to start so in this article thread Try to explain which roadmaps we should follow for learning data science. Just search every topics on internet and learn them you can follow me on  github also where I try to upload the source code of projects you can follow me on github 
https://github.com/Manawariqbal
01
Getting Started with Python
Python Basics
Loops in Python 
Functions in Python 
Strings in Python 
Data Structure

2
Files and JSON
Getting started with Files
Minor Project:Inventory Management System with Files 
Minor Project: Inventory Management System with JSON
3
OS with Python
Getting started with OS 
Jupyter Notebook Setup
OS with Python
4
Mastering Numpy Arrays
Mastering Numpy Arrays
05
Data Analysis with Python
Getting started with Pandas
Statistics
Data Preprocessing
Data Analysis 
Minor Project: Black Friday Sales Data Analysis
Minor Project: Data Visualization on Heart Disease Dataset
Minor Project: GDP Analysis 
06
Tableau
Introduction to Tableau
Understanding Parameters
Basic Plots in Tableau
Fundamentals of Tableau
Designing the Plots
Project 1 - Superstore Sales Analysis Dashboard
Project 2 - Covid-19 World Dashbaord
07
Web Scraping
To Scrape 
Minor Project: Wikipedia Scraper
Selenium
Minor Project: Youtube Scrapper
Minor Project: Stock Images Infinite Scroll
Image Dataset Creation
08
Getting Started with AI
Introduction to AI
How Data Science Comes into Play
09
Machine Learning
Linear Regression
Multiple Linear Regression
Polynomial Linear Regression 
Support Vector Machine
Decision Tree
Random Forest
Classification Algorithms
Clustering Algorithms
Feature Engineering
10
Image Processing
Pixels with Lists
Image and Gradient Formation 
Image Manipulation 
Instagram Filters Colour and Patterns
Edge, Contour and Colour Detection
Face Detection with HaarCascase
Webcam using OpenCV
Image Manipulation with Live Webcam
Realtime Face Image Processing
11
Deep Learning
Perceptrons
Multi layer perceptron architecture
Convolutional neural network

12
Natural Language Processing
Getting started with Text
Regular Expression with Python
Getting started with Spacy and PDF
Text Encoding Decoding from Scratch


13
Major Projects
MNIST Handwritten Digit Recogniser
Titanic Survival | EDA
Stock Image Scrapper
Encrypt a number
Tags: c
Published: 2022-11-24 14:37:03

Hello everyone. I am self learning C from the Dietel and Dietel book C How to program. I am doing an assignment at the end of the chapter that requires a user to enter a four digit integer that will be encrypted as follows. Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then swap first digit with third, and second with fourth. Then display the digit. I think I can solve the first part of the problem. I am not sure how I will switch the digits places. Any suggestions is appreciated. So far the material have only covered while loop, if, else if, and I can only use what's available to me up to this point. I look forward to your suggestions. Thank you.
Python Programming Bootcamp #4 - Variables. Assignment
Tags: python, beginners, tutorial
Published: 2022-11-24 14:24:00

---
title: Python Programming Bootcamp #4 - Variables. Assignment
published: true
description: A short video on variables, assignment, adding numbers and adding strings (concatenating) together.
tags: python, beginners, tutorial
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
published_at: 2022-11-24 14:24 +0000
canonical_url: https://code-maven.com/programming-bootcamp-for-scientists-4
series: bootcamp
---

{% youtube 4FEiFbk7hvg %}


00:00 The end of the "First steps" chapter.
01:20 Variables. Assignment. Multiplying numbers.
03:20 Multiply two string. (Ctrl-g is used in many editors to go to a line-number)
05:50 Adding numbers together.
06:10 Adding strings together. (concatenation)
08:23 Exercises: Calculations
Data Masking
Tags: etl, beginners, tutorial, database
Published: 2022-11-24 14:04:27

What is Data Masking?
- Data Masking is a process that is used to hide data.
- In Data Masking, real data is masked or hidden by replacing them with random characters.
- It protects confidential information from those who don’t have the authorization to see it.

Why Data Masking Is Required?
- Data Masking shields PII data and other confidential information of the organization.
- It secures the file transferring process from one location to another.
- It also helps to secure application development, testing, or CRM applications.
- It allows users to access dummy data for testing or training purposes.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jng9k90fy3ejjm4it7m.png)
Image Source: Wallarm

Data Masking Process
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3vm3z3rrbxvoroasp9i1.png)

Data Masking Tools
- K2View Data Masking
- Delphix
- Oracle Data Masking and Subsetting
- Accutive Data Discovery & Masking
Internet Computer!
Published: 2022-11-24 14:03:25

  The Internet Computer is the world’s first blockchain that runs at web speed with unlimited capacity, resolving the "blockchain trilemma’" by producing a blockchain network that is decentralized, secure, and scalable.


![ICP uses](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mdaf2gr32mgiwilcvz9c.jpg)
___

## 3 Reasons why ICP is next big thing!  

</br>

### Truly Decentralised

A vast majority of blockchains are not truly decentralised. Reports show  majority of 4,653 active Ethereum nodes are in the hands of centralized web providers like Amazon Web Services (AWS), which could “expose Ethereum to central points of failure,” according to crypto analytics platform Messari.  
</br>

### Cost of storing data on blockchain

![Storing cost](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nong89n4sufm4gnhzjux.png)

Extremely low fees to store data on blockchain.  
</br>

### Blazingly Fast


![Speed Comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4463olistnfqno7glk2.png)

Super-high Transactions per second.  
</br>

###### View mind blowing apps [here](https://internetcomputer.org/showcase?)
How to remove a network with active endpoints in Docker
Tags: commandline, docker
Published: 2022-12-01 06:27:05

---
title: How to remove a network with active endpoints in Docker
published: true
date: 2022-11-24 14:00:00 UTC
tags: commandline,docker
canonical_url: https://diegocarrasco.com/how-to-remove-a-network-with-active-endpoints-in-docker/
---

![](https://diegocarrasco.com/how-to-remove-a-network-with-active-endpoints-in-docker/'/images/how-to-remove-a-network-with-active-endpoints-in-docker.png')

 
## Problem: `ERROR: error while removing network`

I wanted to run `docker-compose down` but it failed due to the following error:

```
ERROR: error while removing network: network <your\_network> id cfcb4a603426f2cf71b1f971a9ecb0aae7e6c889a8dc4c55bfd1eb010d8a260b has active endpoints

```

## Solution

To solve this just run `docker network inspect <your_network>` with the rights permissions. (You may also use sudo if you have the permission).

The output of that command is something like this:

```
[
    {
        "Name": "your\_network",
        "Id": "cfcb4a603426f2cf71b1f971a9ecb0aae7e6c889a8dc4c55bfd1eb010d8a260b",
        "Created": "2021-05-05T10:58:08.216143067+02:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.38.0/24",
                    "Gateway": "10.0.38.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "cf8f158e34d07bb3be8ff73e21fc688dce1ba13a5b941a7a59aff1373a74be8f": {
                "Name": "phpmyadmin\_phpmyadmin\_1",
                "EndpointID": "e77d58d75ee31a37ee2cced2658c36480c4f209d8eedf29d4d281f8073457eb1",
                "MacAddress": "02:42:0a:00:26:05",
                "IPv4Address": "10.0.38.5/24",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "default",
            "com.docker.compose.project": "your\_project",
            "com.docker.compose.version": "1.28.5"
        }
    }
]

```

In this case the network is `your_network` and the endpoint is in `containers -> name`.

Now you can use `sudo docker network disconnect -f your_network phpmyadmin_phpmyadmin_1`. This will disconnect the network from the instance, and you will be able to run `docker-compose down` without problems.

Source: [This answer in Stack Overflow](https://stackoverflow.com/a/64894639/624088)