Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
omplete this javascript file according to the individual instructions
given in the comments.
*** DO NOT CHANGE any of the code that you are not instructed to. */
////////////////////////
// NOTE: Use the API endpoints available at
// https://jsonplaceholder.typicode.com/
// to get the data required in these exercises.
// HINT: Read the documented Resources and Routes.
// Also the guide:
// https://jsonplaceholder.typicode.com/guide/
///////////////////////
Create a function named "getUser".
// This function needs to accept a "userID"
// parameter.
// Use Fetch with Async/Await to request
// the data for the requested user.
// The function should return JSON data.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 3 images
Knowledge Booster
Similar questions
- Exclude any existing source code files that may already be in your IDE project and add a new onenamed C2A1E5_ResizeAlloc.c. Also add instructor-supplied source code file C2A1E5_main-Driver.c. Donot write a main function! main already exists in the instructor-supplied file and it will use the code youwrite. File C2A1E5_ResizeAlloc.c (I used 8 lines of code but you don’t have to match or beat that.)must contain the definition of a function named ResizeAlloc that returns type “pointer to void”and has three parameters. The first is named pOld and is of type “pointer to void” while the secondand third are named newSize and oldSize, respectively, and are both of type size_t.ResizeAlloc either dynamically allocates an entirely new block of memory containing newSizebytes or, in effect, resizes an existing block in pOld containing oldSize bytes to contain newSizebytes. When resizing occurs all existing data that will fit into newSize bytes will be preserved.ResizeAlloc may not call calloc or…arrow_forwardI need help with this one please, already tried but still getting a wrong answer Scenario You have been tasked with building a URL file validator for a web crawler. A web crawler is an application that fetches a web page, extracts the URLs present in that page, and then recursively fetches new pages using the extracted URLs. The end goal of a web crawler is to collect text data, images, or other resources present in order to validate resource URLs or hyperlinks on a page. URL validators can be useful to validate if the extracted URL is a valid resource to fetch. In this scenario, you will build a URL validator that checks for supported protocols and file types. Task Create two lists of strings – one list for Protocol called valid_protocols, and one list for storing File extension called valid_fileinfo. For this take the protocol list should be restricted to http, https and ftp. The file extension list should be .html, .csv and .docx. Split an input named url, and then use the first…arrow_forward1(WEB SCRAPING WITH THE REQUESTS AND BEAUTIFUL SOUP LIBRARIES) Web pages are excellent sources of text to use in NLP tasks. In the following IPython session, you’ll use the requests library to download the www.python.org home page’s content. This is called web scraping. You’ll then use the Beautiful Soup library37 to extract only the text from the page. Eliminate the stop words in the resulting text, then use the wordcloud module to create a word cloud based on the text. Its module name is bs4for Beautiful Soup 4. In [1]: importrequests In [2]: response = requests.get('https://www.python.org') In [3]: response.content # gives back the page's HTML In [4]: frombs4 importBeautifulSoup In [5]: soup = BeautifulSoup(response.content, 'html5lib') In [6]: text = soup.get_text(strip=True) # text without tags In the preceding code, snippets [1]–[3] get a web page. The get functionreceives a URL as an argument and returns the corresponding web page as a Response object. The Response’s…arrow_forward
- Next.js Web API Create a words-app directory then create a Next.js 13.3 application inside words-app that implements the following API to manage multiple collections of words.1. Data is provided to you in words.json. The file contains an array of almost every word in the (American) English language. Copy that file to words-app/data/words.json.2. Add an endpoint to search for a certain number of words using a query text. The number of matching words is selected at random and returned. Return 10 words when the number of words is not provided. You should return at most 100 words per request.3. Add an endpoint to read all collections.4. Add an endpoint to read all words in a collection, add a word to a collection, and delete a word from a collection.5. You should validate all parameters provided by the user to the API and respond with an error (4xx) for invalid requests, such as an invalid parameter value, attempting to delete a non-empty collection, or attempting to delete a word from a…arrow_forwardpython: def pokehelp(poke_name, stat_min): """ Question 4 - API You are looking for a Pokemon that can help you with your programming homework. Since Porygon is made of code, you decide to look into the species. Using the given API, return a dictionary that returns the name of each of Porygon's stats with a base stat GREATER THAN the given number, mapped to their value. Do not hardcode Porygon's stats into the results! It is not the only test case. Base URL: https://pokeapi.co/ Endpoint: api/v2/pokemon/{poke_name} Args: Pokemon name (str), stat minimum (int) Returns: Dictonary of stats >>> pokehelp("porygon", 65) {'defense': 70, 'special-attack': 85, 'special-defense': 75} >>> pokehelp("koraidon", 100) {'attack': 135, 'defense': 115, 'speed': 135} """ # pprint(pokehelp("porygon", 65)) # pprint(pokehelp("koraidon", 100))arrow_forwardScenario: You have been tasked with building a URL file validator for a web crawler. A web crawler is an application that fetches a web page, extracts the URLs present in that page, and then recursively fetches new pages using the extracted URLs. The end goal of a web crawler is to collect text data, images, or other resources present in order to validate resource URLs or hyperlinks on a page. URL validators can be useful to validate if the extracted URL is a valid resource to fetch. In this scenario, you will build a URL validator that checks for supported protocols and file types.arrow_forward
- Add comments for assignment p05Thanks! Run it with C, Linuxarrow_forwardYou have more flexibility to implement your own function names and logic in these programs. The data files you need for this assignment can obtained from:Right-click and "Save Link As..." HUGO_genes.txt (Links to an external site.) chr21_genes.txt (Links to an external site.) Create an output directory inside your assignment4 directory called "OUTPUT" for result files, so that they will not mix with your programs. Output from your programs will be here! Your program must implement command line options for the infiles it must open, but for testing purposes it should run by default, so if no command line option is passed at the command line, the program will still run. This will help in the grading of your program. Create a Python Module called called my_io.py - You can use the same code from assignment 3's solution. Put this my_io.py Module in a subdirectory named assignment4 inside your assignment4 top-level directory (see the tree below, and see Lecture 7 on how to implement a…arrow_forwardAccording to the below screenshot of an app, build an Android App that has a set of java files that implement an adapter with RecyclerView. The details of the java files you need to create are described below. The first java file should contain a data field which is in this case: Movie_name, Director_name, Production_year. The second java file contains MovieViewHolder. The third java file contains the MovieAdapter which is act as a bridge between the data items and the View inside of RecycleView. The Mainactivity java file will contain some samples data to display.arrow_forward
- findMin(0,3) O D. findMin(-1,1) findMin(1,-1) findMin(1,1) 5. You have imported a library with the birthMonth() function. Based on the API, how many strings are inputed to calculate the birth month? // calculate birth month based on the day of the month, day of the week, and the birth year // dayMonth {number} - a day of a month from 1 to 31 // dayWeek {string} - the name of the day of the week // year {number} - the birth year // return {string} - the month you were born BirthdayLibrary.birthMonth(dayMonth, dayWeek, year); A. 1 В. 4 000arrow_forwardThank you very much for explaining the absyract concept, it was very helpful and easier to understanc after you explained it. Today we are asked to modify the GridWriter class by adding additional collection style functionality, to throw an exception in case of an error. The GridWriter class should get two new methods: public int size() should return the number of GridItems stored in the GridWriter public GridItem get(int index) should return the stored GridItems by index. Consider the following code. The first line creates a GridWriter object. Then two items are added to the GridWriter. The index of the items will be 0, and 1. Notice how the for loop uses the size and get methods to print out the areas of the two items GridWriter gw = new GridWriter(40, 50); gw.add(new MyCircle(10, 10, 9)); gw.add(new MyRectangle(40, 0, 10, 10)); for (int i = 0; i < gw.size(); i++) { System.out.println(gw.get(i).getArea()); } Once you have these two methods working you…arrow_forward#SumCalculator Class: Create a class named SumCalculator that extends the Thread class. This class calculates the sum of numbers within a provided range. Declare three instance variables: start, end, and sum in the SumCalculator class . start and end are the lower and upper bounds of the range, respectively, while sum stores the sum of the numbers within the range. Create a constructor that takes in two parameters: start and end, and initializes the corresponding instance variables. The sum variable should be initialized to 0. Define the run method to calculate the sum of the numbers within the range. Inside of the run method use a for-loop to iterate over the numbers within the range and add each number to the sum variable. Define the accessor method getSum that returns the value of the sum variable. #Main Class: Create a class named Main that contains the main method, the entry point of the program. Create two objects of the SumCalculator class , with the first…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY