Questions
Following is the activity of javascript. i have tried to do it but got stuck from...

Following is the activity of javascript. i have tried to do it but got stuck from question 3, I have also attached my javascript code right after the HTML file. can you please help me. Inside the java script code, it contains all the necessary token. if you run the html file, it will display longitude as a AQI so need to fix that.

Web Services Activity (1%)

You need to sign up to the API to obtain a key/token at WAQI API [link]

You should save the files as w9-webservices.js and w9-webservices.html

We would like to display the AQI information around the current user's geoposition on a map.

Instructions:

  1. When the page loads, get the user's current location using the Geolocation API's getCurrentPosition method. You should use a callback function.
    Display an appropriate error message as required if geolocation fails to get a position.
  2. In the callback function from (1), you should display a map centered at the current coordinates, with an appropriate zoom level.
  3. Obtain the map coordinate boundaries using MapBox's map.getBounds() method.
  4. Using the map boundary data, make a call to the AQI Map Query API [link: https://aqicn.org/json-api/doc/#api-Map_Queries-GetMapStations ] . You should use a callback function for this API call. The URL (with query string and :placeholders) looks like this: https://api.waqi.info/map/bounds/?token=:token&latlng=:latlng&callback=:callback
  5. In the callback function from (4), display a Marker and associated Popup for each location within the boundary coordinate data from (3). If no data is returned, display an appropriate error message.

    You should ensure that the Marker used is of an appropriate color depending on the AQI value (see table below).

    The Popup should display the AQI value and the station name in plain black text.

    AQI range

    Colour

    0 -- 50

    Green

    51 -- 100

    Yellow

    101 -- 150

    Orange

    151 -- 200

    Red

    201 -- 300

    Purple

    301 -- 500

    Maroon

  6. We can detect when the user changes the zoom level using:
    map.on('zoomend',function(){
        // run some code if the zoom changes
    });
    
    When the user changes the zoom (and thus the map boundaries change), you should update the map information by running (3) -> (5) again.

Notes:

  • You can add CSS inline or to the header section

Here's some code to get you started with the HTML page:

<html>
<head>
  <meta charset="utf-8">
  <title>Week 9 Web Services Activity</title>
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
  <!-- Import MDL libraries -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
  <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
  <script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
  <!-- Import Mapbox libraries -->
  <script src="https://api.mapbox.com/mapbox-gl-js/v1.7.0/mapbox-gl.js"></script>
  <link href="https://api.mapbox.com/mapbox-gl-js/v1.7.0/mapbox-gl.css" rel="stylesheet" />
  <style>
    /* Define any CSS here */
    #map { width: 80vw; height: 80vh }
  </style>
</head>
<body>
  <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
    <header class="mdl-layout__header">
      <div class="mdl-layout__header-row"> <span class="mdl-layout__title">Check the air quality on the map</span> </div>
    </header>
    <main class="mdl-layout__content">
      <div class="mdl-grid">
        <div class="mdl-cell mdl-cell--8-col"> 
          <!-- Map div -->
          <div id='map'>
                    </div>
        </div>
      </div>
    </main>
  </div>
  <script src="w9-webservices.js"></script>
</body>
</html>

w9-webservices.js

"use strict";

// mapbox token

const MAPBOX_TOKEN = "pk.eyJ1IjoidGVlZSIsImEiOiJja2c2ODQ0cHQxMXUwMnJsZDJyOTY5YXRvIn0.0yh14c1R35E-dxvvAC1nxw";

// WAQI token

const WAQI_TOKEN = "4e4ff5b84906529e3768ed72754304c9057587c1";

navigator.geolocation.getCurrentPosition((position) => {

doSomething(position.coords.latitude, position.coords.longitude);

});

function doSomething(lat,lng){

console.log(lat,lng);

mapboxgl.accessToken = MAPBOX_TOKEN;

let map = new mapboxgl.Map({

container: 'map',

style: 'mapbox://styles/mapbox/streets-v9', // stylesheet location

center: [lng,lat], // starting position [lng, lat]

zoom: 13 // starting zoom

}) ;

map.setCenter([lng,lat]);

let marker = new mapboxgl.Marker({ "color": "#FF8C00" });

marker.setLngLat([lng,lat]);

let popup = new mapboxgl.Popup({ offset: 45});

let desc = `AQI: ${lng}`; // at the moment i have just used AQI value as a lngitude.

popup.setHTML(desc);

marker.setPopup(popup)

marker.addTo(map);

popup.addTo(map);

}

In: Computer Science

Mention at least 3 significant changes that came about with the discovery or manipulation of fire....

Mention at least 3 significant changes that came about with the discovery or manipulation of fire.

Changes - what was the change "cooking"

Description - explain how it was manifested, "how it was done"

Reflection - how do you think this changed humanity in general

List and describe the changes that emerged after the discovery and mastery of the use of fire.

Discovering Fire: Big changes in humanity

Changes

Description

Reflection

In: Psychology

Q1. (a) What should molecular properties of a small molecule drug be such that its ADME...

Q1.

(a) What should molecular properties of a small molecule drug be such that its ADME parameters
transports it efficiently across the blood brain barrier? Give examples of the drugs that have these
structural properties (e.g. active transporters)

(b) Use principles of molecular modeling and drug
design to explain the mechanisms of how enzymes evolve new functions.

(c) How is the Buckingham
potential a more realistic one compared to the Lennard Jones potential in modeling VDW interactions
in proteins and nucleic acids? Write out the potential energy expression using the Buckingham
potential. Define and explain its adjustable parameters.

(d) How would you combine a MC and a MD
algorithm to perform a molecular simulation on a biological system.

Q2.

(a) What are the differences between an energy based ligand design method such as GRID and a
knowledge based one like LUDI? What are the requirements of a knowledge based ligand design
method?

(b) Interpret the following QSAR equation: log (1/C)=k 1 ?-k 2 ? 2 + k 3 ?. How are factorial design
methods using in QSAR compound selection? Briefly outline how multiple linear regression analysis is
used in the derivation of a QSAR equation. How is cross-validation used for checking the quality of a
regression based QSAR model?

Q3.

(a) Use the example of molecular docking of the antibiotic netropsin to DNA to distinguish
quantitatively the differences between steepest descent and conjugate gradient methods for initial
refinement and stringent minimization. What qualitative conclusions can be drawn about the efficacy
of these two minimization techniques with respect to this docking experiment?

(b) Using two
examples, explain the thermodynamic differences between the Molecular Dynamics and Monte Carlo
methods. What are the advantages to choosing periodic boundary conditions in ANY molecular
simulation of a macromolecule? Use a diagram to plot 4 such periodic cell shapes. What important
class of applied molecular simulations have benefitted from the usage of periodic boundary
conditions?

In: Biology

Sharpe Middle School is applying for a grant that will be used to add fitness equipment...

Sharpe Middle School is applying for a grant that will be used to add fitness equipment to the gym. The principal surveyed 16 anonymous students to determine how many minutes a day the students spend exercising. The results from the 16 anonymous students are shown.

0 minutes; 40 minutes; 60 minutes; 30 minutes; 60 minutes; 10 minutes; 45 minutes; 30 minutes; 300 minutes; 90 minutes; 30 minutes; 120 minutes; 60 minutes; 60 minutes; 0 minutes; 20 minutes

** Lp = (p/100) (n + 1) (the p-th percentile formula to get the location).

Determine the following five values.

Min =

Q1 =

Med =

Q3 =

Max =

If you were the principal, would you be justified in purchasing new fitness equipment?  

ANSWER:

Is/are there any potential outlier (s)?

IQR=Q3-Q1=……………………………

Lower Limit: Q1 - 1.5(IQR) =…-…………..

Upper Limit: Q3 + 1.5(IQR)=…………..

Calculating the Arithmetic Mean of Grouped Frequency Tables

When only grouped data is available, you do not know the individual data values (we only know intervals and interval frequencies); therefore, you cannot compute an exact mean for the data set. What we must do is estimate the actual mean by calculating the mean of a frequency table. A frequency table is a data representation in which grouped data is displayed along with the corresponding frequencies. To calculate the mean from a grouped frequency table we can apply the basic definition of mean: mean = data sum/number of data values.

We simply need to modify the definition to fit within the restrictions of a frequency table.

Since we do not know the individual data values we can instead find the midpoint of each interval.  

The midpoint is = (lower boundary + upper boundary)/2.

We can now modify the mean definition to be  

                   Mean of Frequency Table = Σ f m/Σ f

where f = the frequency of the interval and m = the midpoint of the interval.

In: Statistics and Probability

Compute the inflation rate for each year 1989-2003 and determine which years were years of inflation. In which years did deflation occur?

(Inflation) Here are some recent data on the U.S. consumer price index:

  • Year CPI                    Year CPI                    Year     CPI       Year     CPI

  • 1988 3                  1993 144.5                  1998     163.0    2003     184.0

  • 1989 0                  1994 148.2                  1999     166.6

  • 1990 7                  1995 152.4                  2000     172.2

  • 1991 2                  1996 156.9                  2001     176.9

  • 1992 3                  1997 160.5                  2002     179.9

  • Compute the inflation rate for each year 1989-2003 and determine which years were years of inflation. In which years did deflation occur? In which years did disinflation occur? Was there hyperinflation in any year?  


In: Economics

Karlene is the new managerial accountant at the Bay Beach House Restaurant. Karlene complies with principles...

Karlene is the new managerial accountant at the Bay Beach House Restaurant. Karlene complies with principles and standards that help accountants deal with ethical challenges that she can encounter in the workplace. The principles and standards ensure that management accountants exhibit the highest level of ethical behavior. The four ethical standards include​ competence, confidentiality,​ integrity, and credibility. Which of the following requires management accountants comply with the four ethical​ standards?

A. Certified Management Accountant​ (CMA)

B. The Federal Reserve Board

C. ​IMA's Statement on Ethical Professional Practice

D. Certified Public Accountant​ (CPA)

E. Sarbanesminus−Oxley Act of 2002

In: Accounting

Over a 17-year period researchers studied a sample of 707 individuals from a single community. They...

Over a 17-year period researchers studied a sample of 707 individuals from a single community. They recorded the number of hours each individual spent watching television during adolescence and early adulthood. in later years, they recorded the number of aggressive acts by individuals in the study. Science magazine published the results in 2002 in an article titled "Television Viewing and Aggressive Behavior during Adolescence and Adulthood."

Pick the best description of this study:

A. an observational study to make an estimate or a claim about a population

B. an experiment to establish a cause-and-effect relationship between two variables

C. an observational study of an association between two variables

In: Statistics and Probability

Pizza and the Subway The “pizza connection” is the principle that that the price of a slice of pizza in New York City is always about the same as the subway fare.

Pizza and the Subway The “pizza connection” is the principle that that the price of a slice of pizza in New York City is always about the same as the subway fare. Use the data listed below to determine whether there is a significant linear correlation between the cost of a slice of pizza and the subway fare.

Year

1960

1973

1986

1995

2002

2003

2009

2013

2015

Pizza cost

0.15

0.35

1.00

1.25

1.75

2.00

2.25

2.30

2.75

Subway Fare

0.15

0.35

1.00

1.35

1.50

2.00

2.25

2.50

2.75

CPI

30.2

48.3

112.3

162.2

191.9

197.8

214.5

233.0

237.2

In: Statistics and Probability

Special purpose entities (SPE) were a factor in Enron’s accounting scandal. Read “The Rise and Fall...

Special purpose entities (SPE) were a factor in Enron’s accounting scandal. Read “The Rise and Fall of Enron” for more background information. Consider that FASB rules at that time only required 3% of the SPE to be held by investors outside of the company. Consider the pros and cons of following the FASB rules. Was Enron in violation of these rules? If not, what was the concern for SPE in Enron’s consolidated financial statements. Be sure to cite ASC codification if utilized in your discussion. USE YOUR OWN WORDS

see like below to find FASB rules

http://www.fasb.org/news/nr070102.shtml

THE RISE AND FALL OF ERON

https://www.journalofaccountancy.com/issues/2002/apr/theriseandfallofenron.html

In: Accounting

Suppose that a typical urban consumer purchases a consumption bundle (CPI Basket) which includes 50 units...

Suppose that a typical urban consumer purchases a consumption bundle (CPI Basket) which includes 50 units of books, 100 units of clothes, 200 units of apples, and 300 units of pizza. The following table shows the unit price of each item in various years.

2000

2001

2002

2003

Book

$10

$12

$14

$12

Cloth

$14

$16

$15

$13

Apple

$3

$3

$5

$5

Pizza

$5

$5

$7

$7

Please answer the following questions;

  1. Calculate the cost of CPI basket.
  2. Choose a base year
  3. Calculate Consumer Price Index (CPI)
  4. Calculate inflation rate.

In: Economics