AbuNayemKhandakar_CPR101_Week6_Activity

docx

School

Seneca College *

*We aren’t endorsed by this school

Course

CPR101NBB

Subject

Mechanical Engineering

Date

Dec 6, 2023

Type

docx

Pages

6

Uploaded by nayem077

Report
CPR101 Activity for Systems Architecture and Design P a g e | 1 Rubric: Mark Allocation and Instructions. Part 1 3 Marks Provide a complete answer to the questions being asked for. If written description is asked for, marks are allocated for proper sentences with correct syntax, spelling, punctuation in English. Part 2 3 Marks Provide a complete answer to the questions being asked for. If screen shots are asked for, make sure you describe what your screen shot is about. If written description is asked for, marks are allocated for proper sentences with correct syntax, spelling, punctuation in English. Part 3 4 Marks Provide a complete answer to the questions being asked for. If screen shots are asked for, make sure you describe what your screen shot is about. If written description is asked for, marks are allocated for proper sentences with correct syntax, spelling, punctuation in English. Part 4 10 Marks Provide a complete answer to the questions being asked for. If screen shots are asked for, make sure you describe what your screen shot is about. If written description is asked for, marks are allocated for proper sentences with correct syntax, spelling, punctuation in English. Total 20 Marks The answers must be handed in by the due data specified in the announcement section of Blackboard. Submittal is done by saving your work in this Word Document and then emailing it to the instructor before the due date. Any paper submitted after the due date will be docked 40%. The reason is that the answers are published/discussed after that date and it penalizes students who wait until the answers are published, do a cut and paste and then submit the paper as their own work. Papers submitted after the beginning of the next class will get a zero for the same reason as above.
CPR101 Activity for Systems Architecture and Design P a g e | 2 Part 1: Navigate to YouTube and watch these two videos about APIs https://www.youtube.com/watch?v=s7wmiS2mSXY https://www.youtube.com/watch?v=OVvTv9Hy91Q 1  An API is like… __________ ? (1 Mark) – Engine under the hood 2  What is sent from the API to a system? (1 Mark) - Request 3  What is sent from the system back through the API? (1 Mark) - Response Part 2: Try out IBM’s demonstration API for language translation . https://www.ibm.com/demos/live/watson-language-translator/self-service/home First elect the “Detect Language” (Start off with English). Then select the language you want your text to be translated into on the right panel box. Enter a phrase to translate from English to French, or another language pair (see IBM’s list of language codes). 1  Provide a screen shot of a sample result here: (3 Marks)
CPR101 Activity for Systems Architecture and Design P a g e | 3 Part 3: Use an API – Application Program Interface See https://developers.google.com/maps/documentation/timezone/intro for an API to look up the timezone information for any GPS coordinate (latitude and longitude). Using this API requires an "API key". Here it is AIzaSyBZQBnlke9vzjcTo0PL1HmggIlhNBh4chU The top of the documentation may look somewhat daunting. Push through. The examples further down will make it clear. Steps to create the URL to access the API: Scroll down until you see: We’ll work with JSON for now.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CPR101 Activity for Systems Architecture and Design P a g e | 4 Click the copy icon. It makes it much easier get the whole URL rather than selecting and copying the long string of text. (It's why the icon is there.) Open Notepad, paste the URL string there to see it all and to strip out any formatting. e.g. https://maps.googleapis.com/maps/api/timezone/json? location =__._______,- __._______& timestamp =__________&key= YOUR_API_KEY Change YOUR_API_KEY to AIzaSyBZQBnlke9vzjcTo0PL1HmggIlhNBh4chU Copy the URL and paste into a browser tab (Ctr l+A, Ctrl+C, Alt-Tab to browser, Ctrl-T, Ctrl+V, ) Example result from the above 3 steps: https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,- 119.6822510×tamp=1331161200&key= AIzaSyBZQBnlke9vzjcTo0PL1HmggIlhNBh4c hU 1  Provide a screen shot of a sample result here with description: (4 Marks) The above query performs a time zone request for Nevada, USA. The timestamp is set to March 8th, 2012. Part 4: Once you have the sample API working, modify the URL request to return the timezone and UTC offset information for Toronto. (UTC = Universal Time Coordinated) You will need Toronto’s location, i.e. its latitude and longitude. This link might help. https://www.google.ca/search?sourceid=chrome- psyapi2&ion=1&espv=2&ie=UTF-8&q=how%20to%20get%20latitude%20and %20longitude%20on%20google%20map&oq=how%20to%20get %20lat&aqs=chrome.1.69i57j0l5.8600j0j7
CPR101 Activity for Systems Architecture and Design P a g e | 5 You will need a current timestamp. This link might help. https://www.unixtimestamp.com/ 1  What is your timezone API request for Toronto right now? Provide the full URL you just came up with: (2 Marks) Eastern Daylight Time https:// maps.googleapis.com/maps/api/timezone/json?location=43.65456631333016%2C- 79.37188843762026×tamp=1697405048&key=AIzaSyBZQBnlke9vzjcTo0PL1HmggIlhNBh4chU 2  What was the JSON Response AND what does JSON mean AND What do the "offset" values mean? Provide a screen shot here with a description of the answers to this question. (3 Marks) Jason Response: The JSON "timeZone" property uses the underlying Java time zone IDs in place of the (GMT+11:00) style values dstOffset The offset for daylight-savings time in seconds. This will be zero if the time zone is not in Daylight Savings Time during the specified timestamp. rawOffset The offset from UTC (in seconds) for the given location. This does not take into effect daylight savings. 3  What was the XML Response AND what does XML mean? This requires a second API request with a slightly different parameter. Try the above steps again, but instead of JSON, use the XML tab. Provide a screen shot of your result with a description (3 Marks)
CPR101 Activity for Systems Architecture and Design P a g e | 6 This shows XML style time zone response with all required info. 4  Convert the UTC timestamp to Toronto's local date/time using the information provided by the API. Unix systems define a timestamp as the number of seconds since Jan 01 1970 UTC. To convert the UTC timestamp to a local timestamp, add the offset values returned by the API. Then convert the local timestamp to the human date/time. (the timestamp given earlier and a calculator will help). Provide your answer here with a description. (2 Mark) UTC: 1697372871 Your time zone : Sunday, October 15, 2023 8:27:51 AM
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help