SlideShare a Scribd company logo
UNTANGLING THE WEB
CLASS 6 – IBM BLUEMIX, A FEW JAVASCRIPT THINGS, MAPS
AGENDA
• IBM Bluemix
• Javascript concepts – variable scope, this pointer, events,
immediately invoked functions
• Mapping using Google Maps
• Some project work, if we have time
• Homework 7
IBM BLUEMIX
• This is one of the top 3 or 4 cloud platform providers
• AWS
• Azure
• Google Cloud Platform
• IBM Bluemix
• Provides servers, but lots of people do that
• Integrated services are the real key to why a platform is
valuable
CHATBOTS
• Goal is to respond to typed text
• We’ll see it in slack
• Eventually, we’ll talk about speech, etc. layered on top of
chatbots
• This first one will be a very simplistic bot
SOME JS CONCEPTS
VARIABLE SCOPE
• A reminder that variables are only accessible from within the block
they are declared, or children of that block:
• In a file, variables declared outside any functions are global to all the
functions in that file
• In a function, variables declared at the top of the function are accessible to
everywhere within that function
• In a for loop, variables declared within the loop are accessible ONLY within
the loop
• Any identically named variables will be taken from the closest block
• Don’t name the same or your more global variables will be hidden
STRICT MODE
• “use strict”; as the first line of a js file
• Mistakes become errors
• Global variables must be explicitly created
• Some other behaviors change
• See https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Strict_mode
THIS
• This keyword retrieves the current execution context
• Some difference in strict mode where it retrieves the context at the time of
the function call
• In non-strict mode, the global context is the default, in strict mode will be at
whatever it was previously defined to, or undefined
• This is the basis of understanding arrow functions (ES6 concept we’ll
explore later)
• Reference:
• https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Op
erators/this
NEW
• function Car(make, model, year) {
• this.make = make;
• this.model = model;
• this.year = year;
• }
• var mycar = new Car("Eagle", "Talon TSi", 1993);
• console.log(mycar.make);
EVENTS
• There are also events on the document object model, but we
won’t discuss that in depth today
• Events are called when something happens – a UI action, a
message, a timer, etc.
• google.maps.event.addListener
IMMEDIATELY INVOKED FUNCTION
EXPRESSIONS (IIFE)
• (function () {
• })();
• The first pair of parentheses (function(){...}) turns the code within (in this case, a
function) into an expression, and the second pair of parentheses (function(){...})()
calls the function that results from that evaluated expression.
• This pattern is often used when trying to avoid polluting the global namespace,
because all the variables used inside the IIFE (like in any other normal function)
are not visible outside its scope.
EXERCISES
• Create a web page in jsfiddle with a button on it
• Here is a fiddle with the bootstrap resources to start with:
https://jsfiddle.net/2adu8f3z/
• Using bootstrap, position the button in the centre of the page (at
the top)
• Hint: there is a center-block definition in bootstrap
• Make the text of the button red
• When you press that button make it invoke a function that raises an
alert
• When you press the button keep track of the number of times it has
been pressed and display that number in the alert
EXERCISE ANSWERS
• https://jsfiddle.net/L3wLvvnL/5/
MAPPING
• Two main options
• Google maps
• Leaflet
• Main decision is really whether to be in the google ecosphere
• Google maps may be slightly easier initially, but leaflet is easier
to extend
• Leaflet sits primarily on open street maps, so perhaps less
detail than google
GOOGLE MAPS EXAMPLE
• Getting an API key (will initially work without it, but some features disabled and will not
keep working)
• https://developers.google.com/maps/documentation/javascript/get-api-key
• https://jsfiddle.net/v892njbz/1/
• Key concepts
• Arrays (review)
• Looping (review)
• New objects
GOOGLE MAPS EXAMPLE 2
• New concepts
• Events
• https://jsfiddle.net/qswaLznm/5/
GOOGLE MAPS EXAMPLE 3
• New Concept
• Immediately Invoked Function Expression (IIFE)
• https://jsfiddle.net/v892njbz/
BITCOIN DISCUSSION (IF WE HAVE TIME)
• Who has used bitcoin? Knows about it?
• Perhaps watch the Singularity University video
HOMEWORK 6
• 1) create a web page that shows a map of the Uvic campus, using
your own google API key
• 2) on that campus map, create 3 markers.
• 3) when the marker is clicked on, launch a pop-up dialog that shows
the latitude and longitude of the marker, and a count of the number
of markers that have been shown so far
• Turn this in by oct 18th start of class, submitting your github
repository and a link to the page running on github pages.
PROJECT 2 – DUE START OF CLASS OCT
25TH
• Groups of 3-4 (no smaller than 2, no larger than 5)
• You will design and implement a website business
• This website must contain 3-4 html pages, a map (we’ll discuss
this next week), a database mockup (you’ll do the UI only in
this project, the database itself will be for project 3), and a
chatbot (also for project 3, but you’ll do the dialog design for
this project)
PROJECT 2 DELIVERABLES
• A business model canvas and value proposition canvas for your
website business
• 3-4 web pages, hosted on github pages, that are styled nicely in CSS
• A half-page discussion of which SEO factors your website exhibits
• A functional map on one of the pages, although it does not have to
be completely populated
• A presentation of between 3-5 minutes giving a walkthrough of the
website concept
• This project is worth 15% of your mark and all group members will
get the same mark. Switching groups between projects 2 and 3 is
discouraged but not impossible.

More Related Content

What's hot

Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11
Derek Jacoby
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
Derek Jacoby
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
Derek Jacoby
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
Derek Jacoby
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10
Derek Jacoby
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
Derek Jacoby
 
Untangling7
Untangling7Untangling7
Untangling7
Derek Jacoby
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3
Derek Jacoby
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
Derek Jacoby
 
Untangling6
Untangling6Untangling6
Untangling6
Derek Jacoby
 
5 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 55 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 5
Dylan Jay
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
Derek Jacoby
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
Victor De Alba
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
Derek Jacoby
 
Untangling11
Untangling11Untangling11
Untangling11
Derek Jacoby
 
Last Call Media Drupal 8 Case Study
Last Call Media Drupal 8 Case StudyLast Call Media Drupal 8 Case Study
Last Call Media Drupal 8 Case Study
Design for Drupal, Boston
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to Go
Weng Wei
 
Working local
Working localWorking local
The New Design Workflow
The New Design WorkflowThe New Design Workflow
The New Design Workflow
Phase2
 
Fast Web Applications with Go
Fast Web Applications with Go Fast Web Applications with Go
Fast Web Applications with Go
Eylem Ozekin
 

What's hot (20)

Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
 
Untangling7
Untangling7Untangling7
Untangling7
 
Untangling the web - week 3
Untangling the web - week 3Untangling the web - week 3
Untangling the web - week 3
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Untangling6
Untangling6Untangling6
Untangling6
 
5 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 55 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 5
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
 
Untangling11
Untangling11Untangling11
Untangling11
 
Last Call Media Drupal 8 Case Study
Last Call Media Drupal 8 Case StudyLast Call Media Drupal 8 Case Study
Last Call Media Drupal 8 Case Study
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to Go
 
Working local
Working localWorking local
Working local
 
The New Design Workflow
The New Design WorkflowThe New Design Workflow
The New Design Workflow
 
Fast Web Applications with Go
Fast Web Applications with Go Fast Web Applications with Go
Fast Web Applications with Go
 

Similar to Untangling - fall2017 - week6

Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
Derek Jacoby
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
Derek Jacoby
 
ProjectFork 4.1 in Joomla! 3.x
ProjectFork 4.1 in Joomla! 3.xProjectFork 4.1 in Joomla! 3.x
ProjectFork 4.1 in Joomla! 3.x
Russell Searle
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
Derek Jacoby
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8
Acquia
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
Guillaume Laforge
 
Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)
Brooklyn Zelenka
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
Paul Jensen
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
heyMP
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
Paul van Zyl
 
Plone FSR
Plone FSRPlone FSR
Plone FSR
fulv
 
Using Features
Using FeaturesUsing Features
Using Features
Alexandru Badiu
 
Automation in Drupal
Automation in DrupalAutomation in Drupal
Automation in Drupal
Bozhidar Boshnakov
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
Geoff Harcourt
 
Python and GIS: Improving Your Workflow
Python and GIS: Improving Your WorkflowPython and GIS: Improving Your Workflow
Python and GIS: Improving Your Workflow
John Reiser
 
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit EuropeAutomation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
AppDynamics
 
DevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGuys - DevOps Automation - The Good, The Bad and The UglyDevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGroup
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
Jonas Brømsø
 
Future of Grails
Future of GrailsFuture of Grails
Future of Grails
Daniel Woods
 

Similar to Untangling - fall2017 - week6 (20)

Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
 
ProjectFork 4.1 in Joomla! 3.x
ProjectFork 4.1 in Joomla! 3.xProjectFork 4.1 in Joomla! 3.x
ProjectFork 4.1 in Joomla! 3.x
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
Plone FSR
Plone FSRPlone FSR
Plone FSR
 
Using Features
Using FeaturesUsing Features
Using Features
 
Automation in Drupal
Automation in DrupalAutomation in Drupal
Automation in Drupal
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Python and GIS: Improving Your Workflow
Python and GIS: Improving Your WorkflowPython and GIS: Improving Your Workflow
Python and GIS: Improving Your Workflow
 
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit EuropeAutomation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
 
DevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGuys - DevOps Automation - The Good, The Bad and The UglyDevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Future of Grails
Future of GrailsFuture of Grails
Future of Grails
 

More from Derek Jacoby

Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3
Derek Jacoby
 
Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1
Derek Jacoby
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12
Derek Jacoby
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10
Derek Jacoby
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7
Derek Jacoby
 
Untangling spring week4
Untangling spring week4Untangling spring week4
Untangling spring week4
Derek Jacoby
 
Untangling8
Untangling8Untangling8
Untangling8
Derek Jacoby
 
Untangling4
Untangling4Untangling4
Untangling4
Derek Jacoby
 

More from Derek Jacoby (8)

Untangling the web fall2017 class 3
Untangling the web fall2017 class 3Untangling the web fall2017 class 3
Untangling the web fall2017 class 3
 
Untangling fall2017 week1
Untangling fall2017 week1Untangling fall2017 week1
Untangling fall2017 week1
 
Untangling spring week12
Untangling spring week12Untangling spring week12
Untangling spring week12
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10
 
Untangling spring week7
Untangling spring week7Untangling spring week7
Untangling spring week7
 
Untangling spring week4
Untangling spring week4Untangling spring week4
Untangling spring week4
 
Untangling8
Untangling8Untangling8
Untangling8
 
Untangling4
Untangling4Untangling4
Untangling4
 

Recently uploaded

A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 

Recently uploaded (20)

A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 

Untangling - fall2017 - week6

  • 1. UNTANGLING THE WEB CLASS 6 – IBM BLUEMIX, A FEW JAVASCRIPT THINGS, MAPS
  • 2. AGENDA • IBM Bluemix • Javascript concepts – variable scope, this pointer, events, immediately invoked functions • Mapping using Google Maps • Some project work, if we have time • Homework 7
  • 3. IBM BLUEMIX • This is one of the top 3 or 4 cloud platform providers • AWS • Azure • Google Cloud Platform • IBM Bluemix • Provides servers, but lots of people do that • Integrated services are the real key to why a platform is valuable
  • 4.
  • 5.
  • 6.
  • 7. CHATBOTS • Goal is to respond to typed text • We’ll see it in slack • Eventually, we’ll talk about speech, etc. layered on top of chatbots • This first one will be a very simplistic bot
  • 8.
  • 9.
  • 10.
  • 11.
  • 13. VARIABLE SCOPE • A reminder that variables are only accessible from within the block they are declared, or children of that block: • In a file, variables declared outside any functions are global to all the functions in that file • In a function, variables declared at the top of the function are accessible to everywhere within that function • In a for loop, variables declared within the loop are accessible ONLY within the loop • Any identically named variables will be taken from the closest block • Don’t name the same or your more global variables will be hidden
  • 14. STRICT MODE • “use strict”; as the first line of a js file • Mistakes become errors • Global variables must be explicitly created • Some other behaviors change • See https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Strict_mode
  • 15. THIS • This keyword retrieves the current execution context • Some difference in strict mode where it retrieves the context at the time of the function call • In non-strict mode, the global context is the default, in strict mode will be at whatever it was previously defined to, or undefined • This is the basis of understanding arrow functions (ES6 concept we’ll explore later) • Reference: • https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Op erators/this
  • 16. NEW • function Car(make, model, year) { • this.make = make; • this.model = model; • this.year = year; • } • var mycar = new Car("Eagle", "Talon TSi", 1993); • console.log(mycar.make);
  • 17. EVENTS • There are also events on the document object model, but we won’t discuss that in depth today • Events are called when something happens – a UI action, a message, a timer, etc. • google.maps.event.addListener
  • 18. IMMEDIATELY INVOKED FUNCTION EXPRESSIONS (IIFE) • (function () { • })(); • The first pair of parentheses (function(){...}) turns the code within (in this case, a function) into an expression, and the second pair of parentheses (function(){...})() calls the function that results from that evaluated expression. • This pattern is often used when trying to avoid polluting the global namespace, because all the variables used inside the IIFE (like in any other normal function) are not visible outside its scope.
  • 19. EXERCISES • Create a web page in jsfiddle with a button on it • Here is a fiddle with the bootstrap resources to start with: https://jsfiddle.net/2adu8f3z/ • Using bootstrap, position the button in the centre of the page (at the top) • Hint: there is a center-block definition in bootstrap • Make the text of the button red • When you press that button make it invoke a function that raises an alert • When you press the button keep track of the number of times it has been pressed and display that number in the alert
  • 21. MAPPING • Two main options • Google maps • Leaflet • Main decision is really whether to be in the google ecosphere • Google maps may be slightly easier initially, but leaflet is easier to extend • Leaflet sits primarily on open street maps, so perhaps less detail than google
  • 22. GOOGLE MAPS EXAMPLE • Getting an API key (will initially work without it, but some features disabled and will not keep working) • https://developers.google.com/maps/documentation/javascript/get-api-key • https://jsfiddle.net/v892njbz/1/ • Key concepts • Arrays (review) • Looping (review) • New objects
  • 23. GOOGLE MAPS EXAMPLE 2 • New concepts • Events • https://jsfiddle.net/qswaLznm/5/
  • 24. GOOGLE MAPS EXAMPLE 3 • New Concept • Immediately Invoked Function Expression (IIFE) • https://jsfiddle.net/v892njbz/
  • 25. BITCOIN DISCUSSION (IF WE HAVE TIME) • Who has used bitcoin? Knows about it? • Perhaps watch the Singularity University video
  • 26. HOMEWORK 6 • 1) create a web page that shows a map of the Uvic campus, using your own google API key • 2) on that campus map, create 3 markers. • 3) when the marker is clicked on, launch a pop-up dialog that shows the latitude and longitude of the marker, and a count of the number of markers that have been shown so far • Turn this in by oct 18th start of class, submitting your github repository and a link to the page running on github pages.
  • 27. PROJECT 2 – DUE START OF CLASS OCT 25TH • Groups of 3-4 (no smaller than 2, no larger than 5) • You will design and implement a website business • This website must contain 3-4 html pages, a map (we’ll discuss this next week), a database mockup (you’ll do the UI only in this project, the database itself will be for project 3), and a chatbot (also for project 3, but you’ll do the dialog design for this project)
  • 28. PROJECT 2 DELIVERABLES • A business model canvas and value proposition canvas for your website business • 3-4 web pages, hosted on github pages, that are styled nicely in CSS • A half-page discussion of which SEO factors your website exhibits • A functional map on one of the pages, although it does not have to be completely populated • A presentation of between 3-5 minutes giving a walkthrough of the website concept • This project is worth 15% of your mark and all group members will get the same mark. Switching groups between projects 2 and 3 is discouraged but not impossible.