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
Untangling - fall2017 - week6
Untangling - fall2017 - week6
Untangling - fall2017 - week6
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
Untangling - fall2017 - week6
Untangling - fall2017 - week6
Untangling - fall2017 - week6
Untangling - fall2017 - week6
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 (20)

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
Working local
Melody Sharp Web Design
 
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
 
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
 
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
 
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
 
Untangling - fall2017 - week 10
Untangling - fall2017 - week 10Untangling - fall2017 - week 10
Untangling - fall2017 - week 10
Derek Jacoby
 
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
 
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
 

Similar to Untangling - fall2017 - week6 (20)

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
 
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
 
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
 

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
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
 
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
 

Recently uploaded (20)

apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 

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
  • 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
  • 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.