SlideShare a Scribd company logo
1 of 55
Download to read offline
Coding 210
Parsing JSON in C++
Mike Maas, Technical Evangelist – IoE, DevNet, @mike_maas
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  Introductions
•  Overview
•  Requirements
•  C++ Primer
•  Requesting Content
•  Parsing Content
•  Resources
Agenda
3
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Introductions
•  Who Am I?
•  Mike Maas, Technical Evangelist – Internet of Everything, DevNet
•  Why this session? Why C++?
•  It is not going away
•  http://stackoverflow.com/research/developer-survey-2015#tech
•  http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
•  http://langpop.com/
•  C > C++ > C++11 > C++14
•  Great for constrained applications
•  Better performance and control of resources
4
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Overview
5
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Overview
•  Goals
•  Build upon Coding 101 and Coding 201
•  Briefest introduction to C++ and application compilation
•  Deeper understanding of using C++ to collect information from the network
•  Further inspection of JSON and the tools available to evaluate JSON content
•  Understand the methods and implementation of parsing JSON
•  What we won't be covering
•  Many C/C++ Features, Integrated Development Environments (IDEs) and other tools
•  Authentication
•  Oauth, Digest/Form/etc.
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Overview
•  What we are going to work on
•  Using Postman
•  Learning a little bit about CMX
•  Understanding how to use C++ and useful libraries to parse data
•  Understanding some of the challenges of parsing data
•  Seeing some of the errors you might encounter
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requirements
8
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requirements: Tools
•  A web browser (Chrome)
•  http://getchrome.com
•  C/C++ Compiler
•  Text Editor
•  Git (Optional)
•  http://git-scm.com/
•  Postman (Optional)
•  Get from the Chrome Web Store or the standalone version at
http://www.getpostman.com/
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requirements: Expertise
•  Basic computer skills / Accessing web sites
•  Using the command-line for your Operating System
•  Some skills in scripting or computer automation
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requirements: OS X
•  Install the G++ C/C++ Compiler
•  Install XCode
•  Install Command Line Developer Tools for OS X
•  Open a Terminal
•  Launch a terminal via Spotlight > Terminal
•  Type g++ --version
•  We should get something like "Apple LLVM version 6.1.0"
•  If we don't
•  On OS X : Verify you have XCode and the command line tools installed
Pre-Flight Check: C/C++ Compiler
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requirements: Windows
•  Install Cygwin on your computer
•  Install the g++ C/C++ Compiler
•  Run Cygwin, Install from Internet,
•  Within the Cygwin setup, install the following:
•  gcc-g++, openssl-devel, libssh2-devel, libcurl-devel, libcurl4
•  Open a console
•  Locate and start the Cygwin terminal
•  Type g++ --version
•  We should get something like "g++ (GCC) 4.9.2"
•  If we don't
•  Verify you are running it from a Cygwin terminal
Pre-Flight Check: C/C++ Compiler
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requirements
•  Install Postman if you don't already have it installed
•  This isn't required but it is a very useful tool
•  Available at http://www.getpostman.com/
•  If you are used to a different tool (SoapUI, Chrome DevTools, etc.) – Feel free
•  Browser-based version or Standalone packaged application is fine
Pre-Flight Check: Postman
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requirements: Code
14
•  GitHub
•  https://github.com/CiscoDevNet/coding-skills-sample-code
•  coding210-parsing-json-c++
•  To Clone locally run the following command:
•  git clone https://github.com/CiscoDevNet/coding-skills-sample-code.git
•  Within our source directory we will also need to clone libcurl and RapidJSON
•  git clone https://github.com/bagder/curl.git
•  git clone https://github.com/miloyip/rapidjson.git
All the samples used are available online
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Optional: Tools
15
•  JSON Test
•  http://www.jsontest.com/
•  JSON Lint
•  http://jsonlint.com/
•  JSON Placeholder
•  http://jsonplaceholder.typicode.com/
Other online resources for our foray into JSON parsing
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
C++ Primer
16
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
C++ is a standardized, object-oriented
programming language. It is designed
for efficiency, performance, and
flexibility of use.
What is C++?
17
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  C/C++ has a notable barriers to entry
•  Broad Syntax / Deep Feature Set
•  Pointers/References, Generics
•  Object Oriented Conceptualization, Programming, and Design
•  Class > Object, Inheritance/Polymorphism, etc.
•  Compilation
•  Many different compilation tools and toolchains
•  http://en.wikipedia.org/wiki/List_of_compilers#C.2B.2B_compilers
•  GUIs are not it's primary concern
•  Lots of Dragons and Grognards be there
C++ Primer
18
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  Typed Programming Languages
•  Static / Compile-Time / Strong
•  Ada, C, C++, C#, Java, Pascal, …
•  Dynamic / Run-Time / Weak
•  JavaScript, Lisp, Lua, Python, Ruby, Perl, Smalltalk, …
•  Optionally Both
•  Objective-C, TypeScript, …
•  Runtimes
•  Java, Python, Common Language Runtime (CLR), etc use an interpreter executable
for a particular platform
•  C/C++ Create a executable for a particular platform
C++ Primer – Compare and Contrast
19
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  C#
•  Compiles to Common Intermediate
Language (CIL)
•  Uses the CLR
•  Garbage Collected
•  Platform includes Standard Libraries
•  Syntax Differences
•  Types
•  Object versions of types
•  long = 8 bytes
•  Control
•  switch explicit
•  Inheritance
•  …
•  C++
•  Compiles to a platform machine code
•  Not Garbage Collected
•  Developer includes Standard Libraries
•  Syntax Differences
•  Types
•  Fundamental types
•  long = 4 bytes
•  Control
•  switch falls through
•  Inheritance
•  …
C++ Primer – Compare and Contrast
20
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  To just get something to the screen…
•  Create a syntactically correct source code file with a main entry point
•  Compile that source code file
•  Link the resultant object code into an Application
•  Run the resultant Application
C++ Primer – Compare and Contrast : HelloWorld!
21
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
• C#
using System;
public class HelloWorld
{
static public void Main()
{
Console.WriteLine("Hello World!");
Console.WriteLine("How are you?");
}
}
• C++
#include <iostream>
int main()
{
std::cout << "Hello World!n";
std::cout << "How are you?n";
return 0;
}
C++ Primer – Compare and Contrast : HelloWorld!
22
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Activity 1 : Compilation
23
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Creating an application via C++
•  Get Code Via Git
•  Git clone the following command:
•  git clone https://github.com/
CiscoDevNet/coding-skills-sample-
code.git
Let’s get something to look at in our console
•  Get Code Via Download
•  Download the following file:
•  https://github.com/CiscoDevNet/coding-
skills-sample-code/archive/master.zip
•  When you get a coding-skills-sample-code directory/folder
•  Launch a terminal and navigate to coding-skills-sample-code
•  Locate the coding210-parsing-json-c++ directory/folder
•  We will execute commands directly from this folder
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Basic Construction via C++
25
.c
.cpp
Compiler Linker
.lib
.o
.dll
.exe
.lib
Source
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  Source Files
•  hello-world.cpp (valid C++ instructions)
•  Compilation (compiler, assembler, and linker)
g++ -c hello-world.cpp -o hello-world.o
g++ -o hello hello-world.o
- or -
g++ -o hello hello-world.cpp
•  Output
•  hello (OS X), hello.exe (Windows)
Basic Construction
26
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requesting Content
27
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Request and Response
•  Request
•  What you want
•  Parameters
•  Response results can often be controlled via Request elements
•  URL query params
•  Form-based transactions
•  HTTP Headers
•  Pseudo Extensions (https://stream.twitter.com/1.1/statuses/sample.json)
•  Response
•  What you get
•  Content
•  Can often return the same data in different formats per request
•  XML, JSON, ATOM, …
What you want; what you get
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
HTTP
•  What does HTTP stand for? (HT) & (TP)
•  What is the most relevant part of the definition for us today?
•  Headers
•  Authorization
•  Accept
•  Charset, Encoding, Language
•  Actions
•  GET – Actually get content
•  POST – Create new content
•  DELETE – Delete content
•  PUT – Update content
•  Content Description
•  MIME Types
•  For HTTP the content is negotiated
A brief word about HTTP
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Requesting Content via Postman
30
•  From Postman
•  In the Request field enter our test URL
•  http://jsonplaceholder.typicode.com/users
•  Click Send
•  From a Browser
•  Just put http://jsonplaceholder.typicode.com/users in as the URL
•  We should get some JSON returned
Let’s get something to look at
http://jsonplaceholder.typicode.com/users
http://jsonplaceholder.typicode.com/todos
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Understanding the structure of the Response
[
{
"id" : 1,
"name": "Leanne Graham"
},
{
"id": 2,
"name": "Ervin Howell"
}
]
Let's look at this in JSON Lint and then JSON.org.
Let’s look at what we got (Condensed)
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Understanding the structure of the Response
[ (Array)
{ (Object)
"id" : 1, (Value)
"name": "Leanne Graham" (Value)
},
{ (Object)
"id": 2, (Value)
"name": "Ervin Howell" (Value)
}
]
Let’s look at what we got (Condensed)
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Activity 2: Requesting Content
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  What needs to happen?
•  Establish a HyperText Transport Protocol (HTTP) connection
•  Sockets
•  Network Library
•  Send and Receive data against the HyperText Transport Protocol (HTTP)
•  Synchronous/Blocking or Asynchronous/Non-Blocking
•  Parse and handle the Response data
Requesting Content via C++
34
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  Get the libcurl source
•  http://curl.haxx.se/dev/source.html
•  Execute the following command in your source directory:
•  git clone https://github.com/bagder/curl.git
•  Use the cURL functionality
•  Include headers to add libcurl support
•  Use the cURL Easy interface (Synchronous)
- or -
•  Use the cURL Multi interface (Asynchronous)
Requesting Content via C++ using libcurl
35
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  A basic HTTP application
•  main-http.cpp
•  Code available at https://github.com/CiscoDevNet/coding-skills-sample-code
•  Compile the main-http application
•  g++ -o main-http main-http.cpp –lcurl
•  How do we know what these flags are?
•  curl-config
•  Evaluate the returned results
Requesting Content via C++ using libcurl
36
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Activity 3: Requesting JSON
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  A basic HTTP application that returns JSON
•  main-json.cpp
•  Code available at https://github.com/CiscoDevNet/coding-skills-sample-code
•  Compile the main-http application
•  g++ -o main-json main-json.cpp –lcurl
•  Evaluate the returned results
Requesting JSON via C++ using libcurl
38
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Parsing Content
39
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  Why Parse?
•  Methods of Parsing
•  Don't Parse
•  Output is truly human-readable
•  Do-It-Yourself (DIY) String Parsing
•  Useful for really, really simple string extraction
•  Build or Use a Framework
•  A lot of ready-made libraries and tools are already available
Parsing Content
40
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  Available Libraries
•  jsoncpp
•  rapidjson
•  LibJSON
•  JSON++
•  …
•  JSON.org has lists of utilities at http://json.org/
Methods of Parsing Content
41
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Activity 4: Parsing Content
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  What needs to happen?
•  Need to establish a Data source
•  Identify the Data to extract
•  Walk the String
•  Regular Expressions
•  Parsing Library
•  Extract the Data
•  Instance Counts
•  Copy of the Data itself
•  Do something with the Data
Parsing Content via C++
43
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  Get the RapidJSON source
•  https://github.com/miloyip/rapidjson
•  Execute the following command in your source directory:
•  git clone https://github.com/miloyip/rapidjson.git
•  Use the RapidJSON functionality
•  Include headers to add rapidjson support
Parsing Content via C++ using RapidJSON
44
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  An application that pretties the JSON output
•  main-json-lib
•  Code available at https://github.com/CiscoDevNet/coding-skills-sample-code
•  Compile the main-http application
•  g++ -o main-json-lib main-json-lib.cpp -Irapidjson/include –lcurl
•  Do something with the returned results
•  Like Prettify!
Parsing Content via C++ using RapidJSON
45
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Activity 5: Extracting Content
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  An application that extracts data from the JSON output
•  main
•  Code available at https://github.com/CiscoDevNet/coding-skills-sample-code
•  Compile the main-http application
•  g++ -o main main.cpp -Irapidjson/include –lcurl
•  Do something with the returned results
•  Like Get AccessPoint names from your CMX installation!
Parsing Content via C++ using RapidJSON
47
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Demo: IOx
48
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  IOx
•  Edge Computing
•  C++ on the Edge
•  Cross-Compilation Toolchain
•  x86 > PowerPC
Demonstration
49
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Resources
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Resources
•  On-Site
•  Learning Labs
•  https://learninglabs.cisco.com
•  DevNetizens
Information to help you on your way
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
Resources
•  On-Line
•  Learning Labs
•  https://learninglabs.cisco.com
•  C++
•  http://www.cplusplus.com/
•  http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list/
•  JSON : JSON.org
•  JSON Test : http://www.jsontest.com/
•  JSON Lint : http://jsonlint.com/
•  JSON Placeholder : http://jsonplaceholder.typicode.com/
Information to help you on your way
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++
•  Try it yourself
•  Do a Learning Lab
•  Go Online
•  Read a book
Where to go from here?
53
Thank you
© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID 54
DEVNET-2006	Coding 210: Parsing JSON in C++

More Related Content

What's hot

Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginnersAdam Englander
 
ZF2: Writing Service Components
ZF2: Writing Service ComponentsZF2: Writing Service Components
ZF2: Writing Service ComponentsMike Willbanks
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaPantheon
 
Open Source Options for Building your WebRTC Solution, May 2015 @ WebRTC Conf...
Open Source Options for Building your WebRTC Solution, May 2015 @ WebRTC Conf...Open Source Options for Building your WebRTC Solution, May 2015 @ WebRTC Conf...
Open Source Options for Building your WebRTC Solution, May 2015 @ WebRTC Conf...Alexandre Gouaillard
 
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlantaPlugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlantaAlexandre Gouaillard
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Clark Everetts
 
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019Grid Dynamics
 
Tutorial contributing to nf-core
Tutorial contributing to nf-coreTutorial contributing to nf-core
Tutorial contributing to nf-coreGisela Gabernet
 
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
Tracing Software Build Processes to Uncover License Compliance InconsistenciesTracing Software Build Processes to Uncover License Compliance Inconsistencies
Tracing Software Build Processes to Uncover License Compliance InconsistenciesShane McIntosh
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdatedoscon2007
 
Assisted code review with source{d} lookout
Assisted code review with source{d} lookoutAssisted code review with source{d} lookout
Assisted code review with source{d} lookoutsource{d}
 
Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Anton Babenko
 
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...Shane McIntosh
 
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - IntroductionRakesh Jha
 
Entwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptEntwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptBill Buchan
 
Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51Mark Ginnebaugh
 
Identifying Hotspots in the PostgreSQL Build Process
Identifying Hotspots in the PostgreSQL Build ProcessIdentifying Hotspots in the PostgreSQL Build Process
Identifying Hotspots in the PostgreSQL Build ProcessShane McIntosh
 
CI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineCI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineVeaceslav Gaidarji
 

What's hot (20)

Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginners
 
ZF2: Writing Service Components
ZF2: Writing Service ComponentsZF2: Writing Service Components
ZF2: Writing Service Components
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon Vienna
 
Open Source Options for Building your WebRTC Solution, May 2015 @ WebRTC Conf...
Open Source Options for Building your WebRTC Solution, May 2015 @ WebRTC Conf...Open Source Options for Building your WebRTC Solution, May 2015 @ WebRTC Conf...
Open Source Options for Building your WebRTC Solution, May 2015 @ WebRTC Conf...
 
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlantaPlugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
MPL: modular pipeline library - Dynamic Talks Milwaukee 4/11/2019
 
Tutorial contributing to nf-core
Tutorial contributing to nf-coreTutorial contributing to nf-core
Tutorial contributing to nf-core
 
nf-core usage tutorial
nf-core usage tutorialnf-core usage tutorial
nf-core usage tutorial
 
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
Tracing Software Build Processes to Uncover License Compliance InconsistenciesTracing Software Build Processes to Uncover License Compliance Inconsistencies
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
Assisted code review with source{d} lookout
Assisted code review with source{d} lookoutAssisted code review with source{d} lookout
Assisted code review with source{d} lookout
 
Buildtechs
BuildtechsBuildtechs
Buildtechs
 
Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)
 
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
Tracing Software Build Processes to Uncover License Compliance Inconsistencie...
 
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - Introduction
 
Entwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptEntwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscript
 
Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51
 
Identifying Hotspots in the PostgreSQL Build Process
Identifying Hotspots in the PostgreSQL Build ProcessIdentifying Hotspots in the PostgreSQL Build Process
Identifying Hotspots in the PostgreSQL Build Process
 
CI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineCI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins Pipeline
 

Viewers also liked

知っているようで知らないPAMのお話
知っているようで知らないPAMのお話知っているようで知らないPAMのお話
知っているようで知らないPAMのお話Serverworks Co.,Ltd.
 
Forecasting digital in 2016
Forecasting digital in 2016Forecasting digital in 2016
Forecasting digital in 2016Tuan Anh Nguyen
 
CBIZ Women's Advantage Newsletter - Winter 2015
CBIZ Women's Advantage Newsletter - Winter 2015CBIZ Women's Advantage Newsletter - Winter 2015
CBIZ Women's Advantage Newsletter - Winter 2015CBIZ & MHM Phoenix
 
Pitch presentation
Pitch presentationPitch presentation
Pitch presentationalexjr1996
 
Celador powerpoint
Celador powerpointCelador powerpoint
Celador powerpointalexjr1996
 
Theory of urbanism and architecture
Theory of urbanism and architectureTheory of urbanism and architecture
Theory of urbanism and architectureAlfred Tan
 
DEVNET-1148 Leveraging Cisco OpenStack Private Cloud for Developers
DEVNET-1148	Leveraging Cisco OpenStack Private Cloud for DevelopersDEVNET-1148	Leveraging Cisco OpenStack Private Cloud for Developers
DEVNET-1148 Leveraging Cisco OpenStack Private Cloud for DevelopersCisco DevNet
 
2016 03-17 Diesviering Maasziekenhuis, Boxmeer, Alain van Gool
2016 03-17 Diesviering Maasziekenhuis, Boxmeer, Alain van Gool2016 03-17 Diesviering Maasziekenhuis, Boxmeer, Alain van Gool
2016 03-17 Diesviering Maasziekenhuis, Boxmeer, Alain van GoolAlain van Gool
 
EU FP7 CarTarDis project overview April 2015
EU FP7 CarTarDis project overview April 2015EU FP7 CarTarDis project overview April 2015
EU FP7 CarTarDis project overview April 2015Alain van Gool
 
Psyphotology Intern Presentation
Psyphotology Intern PresentationPsyphotology Intern Presentation
Psyphotology Intern Presentationannarrowley
 
Cac ky thuat_dieu_che_4543
Cac ky thuat_dieu_che_4543Cac ky thuat_dieu_che_4543
Cac ky thuat_dieu_che_4543PTIT HCM
 
2016-07 Interview Medisch Contact
2016-07 Interview Medisch Contact 2016-07 Interview Medisch Contact
2016-07 Interview Medisch Contact Alain van Gool
 

Viewers also liked (20)

知っているようで知らないPAMのお話
知っているようで知らないPAMのお話知っているようで知らないPAMのお話
知っているようで知らないPAMのお話
 
Forecasting digital in 2016
Forecasting digital in 2016Forecasting digital in 2016
Forecasting digital in 2016
 
CBIZ Women's Advantage Newsletter - Winter 2015
CBIZ Women's Advantage Newsletter - Winter 2015CBIZ Women's Advantage Newsletter - Winter 2015
CBIZ Women's Advantage Newsletter - Winter 2015
 
Pitch presentation
Pitch presentationPitch presentation
Pitch presentation
 
Celador powerpoint
Celador powerpointCelador powerpoint
Celador powerpoint
 
Presentacion ids
Presentacion idsPresentacion ids
Presentacion ids
 
Theory of urbanism and architecture
Theory of urbanism and architectureTheory of urbanism and architecture
Theory of urbanism and architecture
 
Kaunas bm šviesuva 2014 11 03
Kaunas   bm šviesuva 2014 11 03Kaunas   bm šviesuva 2014 11 03
Kaunas bm šviesuva 2014 11 03
 
DEVNET-1148 Leveraging Cisco OpenStack Private Cloud for Developers
DEVNET-1148	Leveraging Cisco OpenStack Private Cloud for DevelopersDEVNET-1148	Leveraging Cisco OpenStack Private Cloud for Developers
DEVNET-1148 Leveraging Cisco OpenStack Private Cloud for Developers
 
Esd 14
Esd 14Esd 14
Esd 14
 
Projektu ruosimo pagrindai
Projektu ruosimo pagrindaiProjektu ruosimo pagrindai
Projektu ruosimo pagrindai
 
2016 03-17 Diesviering Maasziekenhuis, Boxmeer, Alain van Gool
2016 03-17 Diesviering Maasziekenhuis, Boxmeer, Alain van Gool2016 03-17 Diesviering Maasziekenhuis, Boxmeer, Alain van Gool
2016 03-17 Diesviering Maasziekenhuis, Boxmeer, Alain van Gool
 
201131065
201131065201131065
201131065
 
Subcription vod
Subcription vod Subcription vod
Subcription vod
 
EU FP7 CarTarDis project overview April 2015
EU FP7 CarTarDis project overview April 2015EU FP7 CarTarDis project overview April 2015
EU FP7 CarTarDis project overview April 2015
 
The magic to think big
The magic to think bigThe magic to think big
The magic to think big
 
Psyphotology Intern Presentation
Psyphotology Intern PresentationPsyphotology Intern Presentation
Psyphotology Intern Presentation
 
Sviesuva istorija 2 dalis
Sviesuva istorija 2 dalisSviesuva istorija 2 dalis
Sviesuva istorija 2 dalis
 
Cac ky thuat_dieu_che_4543
Cac ky thuat_dieu_che_4543Cac ky thuat_dieu_che_4543
Cac ky thuat_dieu_che_4543
 
2016-07 Interview Medisch Contact
2016-07 Interview Medisch Contact 2016-07 Interview Medisch Contact
2016-07 Interview Medisch Contact
 

Similar to DEVNET-2006 Coding 210: Parsing JSON in C++

DEVNET-2002 Coding 201: Coding Skills 201: Going Further with REST and Python...
DEVNET-2002	Coding 201: Coding Skills 201: Going Further with REST and Python...DEVNET-2002	Coding 201: Coding Skills 201: Going Further with REST and Python...
DEVNET-2002 Coding 201: Coding Skills 201: Going Further with REST and Python...Cisco DevNet
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14Kevin Poorman
 
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...Cisco DevNet
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERIndrajit Poddar
 
DevNetCreate Workshop - build a react app - React crash course
DevNetCreate Workshop - build a react app - React crash courseDevNetCreate Workshop - build a react app - React crash course
DevNetCreate Workshop - build a react app - React crash courseCisco DevNet
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Brian Culver
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development PipelineGlobalLogic Ukraine
 
Gocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentGocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentLeandro Totino Pereira
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Annie Huang
 
Docs as Code: Publishing Processes for API Experiences
Docs as Code: Publishing Processes for API ExperiencesDocs as Code: Publishing Processes for API Experiences
Docs as Code: Publishing Processes for API ExperiencesAnne Gentle
 
Webkit Chromium Contribution Process
Webkit Chromium Contribution ProcessWebkit Chromium Contribution Process
Webkit Chromium Contribution ProcessGyuyoung Kim
 
Using cyclomatic complexity to measure code complexity
Using cyclomatic complexity to measure code complexityUsing cyclomatic complexity to measure code complexity
Using cyclomatic complexity to measure code complexityJane Chung
 
Using cyclomatic complexity to measure code complexity
Using cyclomatic complexity to measure code complexityUsing cyclomatic complexity to measure code complexity
Using cyclomatic complexity to measure code complexityOursky
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Max Romanovsky
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovskyphp-user-group-minsk
 
Deep dive into share point framework webparts
Deep dive into share point framework webpartsDeep dive into share point framework webparts
Deep dive into share point framework webpartsPrabhu Nehru
 
Practical Git - NYC Code Camp
Practical Git - NYC Code CampPractical Git - NYC Code Camp
Practical Git - NYC Code CampChristopher Gomez
 
Integrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinIntegrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinDatabricks
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development WorkflowVũ Nguyễn
 
High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014Oliver N
 

Similar to DEVNET-2006 Coding 210: Parsing JSON in C++ (20)

DEVNET-2002 Coding 201: Coding Skills 201: Going Further with REST and Python...
DEVNET-2002	Coding 201: Coding Skills 201: Going Further with REST and Python...DEVNET-2002	Coding 201: Coding Skills 201: Going Further with REST and Python...
DEVNET-2002 Coding 201: Coding Skills 201: Going Further with REST and Python...
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14
 
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
 
DevNetCreate Workshop - build a react app - React crash course
DevNetCreate Workshop - build a react app - React crash courseDevNetCreate Workshop - build a react app - React crash course
DevNetCreate Workshop - build a react app - React crash course
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Gocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentGocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous Deployment
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
 
Docs as Code: Publishing Processes for API Experiences
Docs as Code: Publishing Processes for API ExperiencesDocs as Code: Publishing Processes for API Experiences
Docs as Code: Publishing Processes for API Experiences
 
Webkit Chromium Contribution Process
Webkit Chromium Contribution ProcessWebkit Chromium Contribution Process
Webkit Chromium Contribution Process
 
Using cyclomatic complexity to measure code complexity
Using cyclomatic complexity to measure code complexityUsing cyclomatic complexity to measure code complexity
Using cyclomatic complexity to measure code complexity
 
Using cyclomatic complexity to measure code complexity
Using cyclomatic complexity to measure code complexityUsing cyclomatic complexity to measure code complexity
Using cyclomatic complexity to measure code complexity
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 
Deep dive into share point framework webparts
Deep dive into share point framework webpartsDeep dive into share point framework webparts
Deep dive into share point framework webparts
 
Practical Git - NYC Code Camp
Practical Git - NYC Code CampPractical Git - NYC Code Camp
Practical Git - NYC Code Camp
 
Integrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinIntegrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther Kundin
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
 
High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014
 

More from Cisco DevNet

How to Contribute to Ansible
How to Contribute to AnsibleHow to Contribute to Ansible
How to Contribute to AnsibleCisco DevNet
 
Rome 2017: Building advanced voice assistants and chat bots
Rome 2017: Building advanced voice assistants and chat botsRome 2017: Building advanced voice assistants and chat bots
Rome 2017: Building advanced voice assistants and chat botsCisco DevNet
 
How to Build Advanced Voice Assistants and Chatbots
How to Build Advanced Voice Assistants and ChatbotsHow to Build Advanced Voice Assistants and Chatbots
How to Build Advanced Voice Assistants and ChatbotsCisco DevNet
 
Cisco Spark and Tropo and the Programmable Web
Cisco Spark and Tropo and the Programmable WebCisco Spark and Tropo and the Programmable Web
Cisco Spark and Tropo and the Programmable WebCisco DevNet
 
Device Programmability with Cisco Plug-n-Play Solution
Device Programmability with Cisco Plug-n-Play SolutionDevice Programmability with Cisco Plug-n-Play Solution
Device Programmability with Cisco Plug-n-Play SolutionCisco DevNet
 
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap APIBuilding a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap APICisco DevNet
 
Application Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible NetflowApplication Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible NetflowCisco DevNet
 
WAN Automation Engine API Deep Dive
WAN Automation Engine API Deep DiveWAN Automation Engine API Deep Dive
WAN Automation Engine API Deep DiveCisco DevNet
 
Cisco's Open Device Programmability Strategy: Open Discussion
Cisco's Open Device Programmability Strategy: Open DiscussionCisco's Open Device Programmability Strategy: Open Discussion
Cisco's Open Device Programmability Strategy: Open DiscussionCisco DevNet
 
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Cisco DevNet
 
NETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network DevicesNETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network DevicesCisco DevNet
 
UCS Management APIs A Technical Deep Dive
UCS Management APIs A Technical Deep DiveUCS Management APIs A Technical Deep Dive
UCS Management APIs A Technical Deep DiveCisco DevNet
 
OpenStack Enabling DevOps
OpenStack Enabling DevOpsOpenStack Enabling DevOps
OpenStack Enabling DevOpsCisco DevNet
 
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...Cisco DevNet
 
Getting Started: Developing Tropo Applications
Getting Started: Developing Tropo ApplicationsGetting Started: Developing Tropo Applications
Getting Started: Developing Tropo ApplicationsCisco DevNet
 
Cisco Spark & Tropo API Workshop
Cisco Spark & Tropo API WorkshopCisco Spark & Tropo API Workshop
Cisco Spark & Tropo API WorkshopCisco DevNet
 
Coding 102 REST API Basics Using Spark
Coding 102 REST API Basics Using SparkCoding 102 REST API Basics Using Spark
Coding 102 REST API Basics Using SparkCisco DevNet
 
Cisco APIs: An Interactive Assistant for the Web2Day Developer Conference
Cisco APIs: An Interactive Assistant for the Web2Day Developer ConferenceCisco APIs: An Interactive Assistant for the Web2Day Developer Conference
Cisco APIs: An Interactive Assistant for the Web2Day Developer ConferenceCisco DevNet
 
DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016Cisco DevNet
 
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016Cisco DevNet
 

More from Cisco DevNet (20)

How to Contribute to Ansible
How to Contribute to AnsibleHow to Contribute to Ansible
How to Contribute to Ansible
 
Rome 2017: Building advanced voice assistants and chat bots
Rome 2017: Building advanced voice assistants and chat botsRome 2017: Building advanced voice assistants and chat bots
Rome 2017: Building advanced voice assistants and chat bots
 
How to Build Advanced Voice Assistants and Chatbots
How to Build Advanced Voice Assistants and ChatbotsHow to Build Advanced Voice Assistants and Chatbots
How to Build Advanced Voice Assistants and Chatbots
 
Cisco Spark and Tropo and the Programmable Web
Cisco Spark and Tropo and the Programmable WebCisco Spark and Tropo and the Programmable Web
Cisco Spark and Tropo and the Programmable Web
 
Device Programmability with Cisco Plug-n-Play Solution
Device Programmability with Cisco Plug-n-Play SolutionDevice Programmability with Cisco Plug-n-Play Solution
Device Programmability with Cisco Plug-n-Play Solution
 
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap APIBuilding a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
 
Application Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible NetflowApplication Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible Netflow
 
WAN Automation Engine API Deep Dive
WAN Automation Engine API Deep DiveWAN Automation Engine API Deep Dive
WAN Automation Engine API Deep Dive
 
Cisco's Open Device Programmability Strategy: Open Discussion
Cisco's Open Device Programmability Strategy: Open DiscussionCisco's Open Device Programmability Strategy: Open Discussion
Cisco's Open Device Programmability Strategy: Open Discussion
 
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
 
NETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network DevicesNETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network Devices
 
UCS Management APIs A Technical Deep Dive
UCS Management APIs A Technical Deep DiveUCS Management APIs A Technical Deep Dive
UCS Management APIs A Technical Deep Dive
 
OpenStack Enabling DevOps
OpenStack Enabling DevOpsOpenStack Enabling DevOps
OpenStack Enabling DevOps
 
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
 
Getting Started: Developing Tropo Applications
Getting Started: Developing Tropo ApplicationsGetting Started: Developing Tropo Applications
Getting Started: Developing Tropo Applications
 
Cisco Spark & Tropo API Workshop
Cisco Spark & Tropo API WorkshopCisco Spark & Tropo API Workshop
Cisco Spark & Tropo API Workshop
 
Coding 102 REST API Basics Using Spark
Coding 102 REST API Basics Using SparkCoding 102 REST API Basics Using Spark
Coding 102 REST API Basics Using Spark
 
Cisco APIs: An Interactive Assistant for the Web2Day Developer Conference
Cisco APIs: An Interactive Assistant for the Web2Day Developer ConferenceCisco APIs: An Interactive Assistant for the Web2Day Developer Conference
Cisco APIs: An Interactive Assistant for the Web2Day Developer Conference
 
DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016
 
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
 

Recently uploaded

AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Recently uploaded (20)

AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

DEVNET-2006 Coding 210: Parsing JSON in C++

  • 1.
  • 2. Coding 210 Parsing JSON in C++ Mike Maas, Technical Evangelist – IoE, DevNet, @mike_maas
  • 3. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  Introductions •  Overview •  Requirements •  C++ Primer •  Requesting Content •  Parsing Content •  Resources Agenda 3
  • 4. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Introductions •  Who Am I? •  Mike Maas, Technical Evangelist – Internet of Everything, DevNet •  Why this session? Why C++? •  It is not going away •  http://stackoverflow.com/research/developer-survey-2015#tech •  http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html •  http://langpop.com/ •  C > C++ > C++11 > C++14 •  Great for constrained applications •  Better performance and control of resources 4
  • 5. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Overview 5
  • 6. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Overview •  Goals •  Build upon Coding 101 and Coding 201 •  Briefest introduction to C++ and application compilation •  Deeper understanding of using C++ to collect information from the network •  Further inspection of JSON and the tools available to evaluate JSON content •  Understand the methods and implementation of parsing JSON •  What we won't be covering •  Many C/C++ Features, Integrated Development Environments (IDEs) and other tools •  Authentication •  Oauth, Digest/Form/etc.
  • 7. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Overview •  What we are going to work on •  Using Postman •  Learning a little bit about CMX •  Understanding how to use C++ and useful libraries to parse data •  Understanding some of the challenges of parsing data •  Seeing some of the errors you might encounter
  • 8. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requirements 8
  • 9. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requirements: Tools •  A web browser (Chrome) •  http://getchrome.com •  C/C++ Compiler •  Text Editor •  Git (Optional) •  http://git-scm.com/ •  Postman (Optional) •  Get from the Chrome Web Store or the standalone version at http://www.getpostman.com/
  • 10. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requirements: Expertise •  Basic computer skills / Accessing web sites •  Using the command-line for your Operating System •  Some skills in scripting or computer automation
  • 11. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requirements: OS X •  Install the G++ C/C++ Compiler •  Install XCode •  Install Command Line Developer Tools for OS X •  Open a Terminal •  Launch a terminal via Spotlight > Terminal •  Type g++ --version •  We should get something like "Apple LLVM version 6.1.0" •  If we don't •  On OS X : Verify you have XCode and the command line tools installed Pre-Flight Check: C/C++ Compiler
  • 12. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requirements: Windows •  Install Cygwin on your computer •  Install the g++ C/C++ Compiler •  Run Cygwin, Install from Internet, •  Within the Cygwin setup, install the following: •  gcc-g++, openssl-devel, libssh2-devel, libcurl-devel, libcurl4 •  Open a console •  Locate and start the Cygwin terminal •  Type g++ --version •  We should get something like "g++ (GCC) 4.9.2" •  If we don't •  Verify you are running it from a Cygwin terminal Pre-Flight Check: C/C++ Compiler
  • 13. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requirements •  Install Postman if you don't already have it installed •  This isn't required but it is a very useful tool •  Available at http://www.getpostman.com/ •  If you are used to a different tool (SoapUI, Chrome DevTools, etc.) – Feel free •  Browser-based version or Standalone packaged application is fine Pre-Flight Check: Postman
  • 14. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requirements: Code 14 •  GitHub •  https://github.com/CiscoDevNet/coding-skills-sample-code •  coding210-parsing-json-c++ •  To Clone locally run the following command: •  git clone https://github.com/CiscoDevNet/coding-skills-sample-code.git •  Within our source directory we will also need to clone libcurl and RapidJSON •  git clone https://github.com/bagder/curl.git •  git clone https://github.com/miloyip/rapidjson.git All the samples used are available online
  • 15. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Optional: Tools 15 •  JSON Test •  http://www.jsontest.com/ •  JSON Lint •  http://jsonlint.com/ •  JSON Placeholder •  http://jsonplaceholder.typicode.com/ Other online resources for our foray into JSON parsing
  • 16. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ C++ Primer 16
  • 17. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ C++ is a standardized, object-oriented programming language. It is designed for efficiency, performance, and flexibility of use. What is C++? 17
  • 18. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  C/C++ has a notable barriers to entry •  Broad Syntax / Deep Feature Set •  Pointers/References, Generics •  Object Oriented Conceptualization, Programming, and Design •  Class > Object, Inheritance/Polymorphism, etc. •  Compilation •  Many different compilation tools and toolchains •  http://en.wikipedia.org/wiki/List_of_compilers#C.2B.2B_compilers •  GUIs are not it's primary concern •  Lots of Dragons and Grognards be there C++ Primer 18
  • 19. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  Typed Programming Languages •  Static / Compile-Time / Strong •  Ada, C, C++, C#, Java, Pascal, … •  Dynamic / Run-Time / Weak •  JavaScript, Lisp, Lua, Python, Ruby, Perl, Smalltalk, … •  Optionally Both •  Objective-C, TypeScript, … •  Runtimes •  Java, Python, Common Language Runtime (CLR), etc use an interpreter executable for a particular platform •  C/C++ Create a executable for a particular platform C++ Primer – Compare and Contrast 19
  • 20. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  C# •  Compiles to Common Intermediate Language (CIL) •  Uses the CLR •  Garbage Collected •  Platform includes Standard Libraries •  Syntax Differences •  Types •  Object versions of types •  long = 8 bytes •  Control •  switch explicit •  Inheritance •  … •  C++ •  Compiles to a platform machine code •  Not Garbage Collected •  Developer includes Standard Libraries •  Syntax Differences •  Types •  Fundamental types •  long = 4 bytes •  Control •  switch falls through •  Inheritance •  … C++ Primer – Compare and Contrast 20
  • 21. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  To just get something to the screen… •  Create a syntactically correct source code file with a main entry point •  Compile that source code file •  Link the resultant object code into an Application •  Run the resultant Application C++ Primer – Compare and Contrast : HelloWorld! 21
  • 22. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ • C# using System; public class HelloWorld { static public void Main() { Console.WriteLine("Hello World!"); Console.WriteLine("How are you?"); } } • C++ #include <iostream> int main() { std::cout << "Hello World!n"; std::cout << "How are you?n"; return 0; } C++ Primer – Compare and Contrast : HelloWorld! 22
  • 23. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Activity 1 : Compilation 23
  • 24. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Creating an application via C++ •  Get Code Via Git •  Git clone the following command: •  git clone https://github.com/ CiscoDevNet/coding-skills-sample- code.git Let’s get something to look at in our console •  Get Code Via Download •  Download the following file: •  https://github.com/CiscoDevNet/coding- skills-sample-code/archive/master.zip •  When you get a coding-skills-sample-code directory/folder •  Launch a terminal and navigate to coding-skills-sample-code •  Locate the coding210-parsing-json-c++ directory/folder •  We will execute commands directly from this folder
  • 25. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Basic Construction via C++ 25 .c .cpp Compiler Linker .lib .o .dll .exe .lib Source
  • 26. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  Source Files •  hello-world.cpp (valid C++ instructions) •  Compilation (compiler, assembler, and linker) g++ -c hello-world.cpp -o hello-world.o g++ -o hello hello-world.o - or - g++ -o hello hello-world.cpp •  Output •  hello (OS X), hello.exe (Windows) Basic Construction 26
  • 27. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requesting Content 27
  • 28. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Request and Response •  Request •  What you want •  Parameters •  Response results can often be controlled via Request elements •  URL query params •  Form-based transactions •  HTTP Headers •  Pseudo Extensions (https://stream.twitter.com/1.1/statuses/sample.json) •  Response •  What you get •  Content •  Can often return the same data in different formats per request •  XML, JSON, ATOM, … What you want; what you get
  • 29. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ HTTP •  What does HTTP stand for? (HT) & (TP) •  What is the most relevant part of the definition for us today? •  Headers •  Authorization •  Accept •  Charset, Encoding, Language •  Actions •  GET – Actually get content •  POST – Create new content •  DELETE – Delete content •  PUT – Update content •  Content Description •  MIME Types •  For HTTP the content is negotiated A brief word about HTTP
  • 30. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Requesting Content via Postman 30 •  From Postman •  In the Request field enter our test URL •  http://jsonplaceholder.typicode.com/users •  Click Send •  From a Browser •  Just put http://jsonplaceholder.typicode.com/users in as the URL •  We should get some JSON returned Let’s get something to look at http://jsonplaceholder.typicode.com/users http://jsonplaceholder.typicode.com/todos
  • 31. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Understanding the structure of the Response [ { "id" : 1, "name": "Leanne Graham" }, { "id": 2, "name": "Ervin Howell" } ] Let's look at this in JSON Lint and then JSON.org. Let’s look at what we got (Condensed)
  • 32. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Understanding the structure of the Response [ (Array) { (Object) "id" : 1, (Value) "name": "Leanne Graham" (Value) }, { (Object) "id": 2, (Value) "name": "Ervin Howell" (Value) } ] Let’s look at what we got (Condensed)
  • 33. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Activity 2: Requesting Content
  • 34. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  What needs to happen? •  Establish a HyperText Transport Protocol (HTTP) connection •  Sockets •  Network Library •  Send and Receive data against the HyperText Transport Protocol (HTTP) •  Synchronous/Blocking or Asynchronous/Non-Blocking •  Parse and handle the Response data Requesting Content via C++ 34
  • 35. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  Get the libcurl source •  http://curl.haxx.se/dev/source.html •  Execute the following command in your source directory: •  git clone https://github.com/bagder/curl.git •  Use the cURL functionality •  Include headers to add libcurl support •  Use the cURL Easy interface (Synchronous) - or - •  Use the cURL Multi interface (Asynchronous) Requesting Content via C++ using libcurl 35
  • 36. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  A basic HTTP application •  main-http.cpp •  Code available at https://github.com/CiscoDevNet/coding-skills-sample-code •  Compile the main-http application •  g++ -o main-http main-http.cpp –lcurl •  How do we know what these flags are? •  curl-config •  Evaluate the returned results Requesting Content via C++ using libcurl 36
  • 37. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Activity 3: Requesting JSON
  • 38. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  A basic HTTP application that returns JSON •  main-json.cpp •  Code available at https://github.com/CiscoDevNet/coding-skills-sample-code •  Compile the main-http application •  g++ -o main-json main-json.cpp –lcurl •  Evaluate the returned results Requesting JSON via C++ using libcurl 38
  • 39. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Parsing Content 39
  • 40. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  Why Parse? •  Methods of Parsing •  Don't Parse •  Output is truly human-readable •  Do-It-Yourself (DIY) String Parsing •  Useful for really, really simple string extraction •  Build or Use a Framework •  A lot of ready-made libraries and tools are already available Parsing Content 40
  • 41. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  Available Libraries •  jsoncpp •  rapidjson •  LibJSON •  JSON++ •  … •  JSON.org has lists of utilities at http://json.org/ Methods of Parsing Content 41
  • 42. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Activity 4: Parsing Content
  • 43. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  What needs to happen? •  Need to establish a Data source •  Identify the Data to extract •  Walk the String •  Regular Expressions •  Parsing Library •  Extract the Data •  Instance Counts •  Copy of the Data itself •  Do something with the Data Parsing Content via C++ 43
  • 44. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  Get the RapidJSON source •  https://github.com/miloyip/rapidjson •  Execute the following command in your source directory: •  git clone https://github.com/miloyip/rapidjson.git •  Use the RapidJSON functionality •  Include headers to add rapidjson support Parsing Content via C++ using RapidJSON 44
  • 45. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  An application that pretties the JSON output •  main-json-lib •  Code available at https://github.com/CiscoDevNet/coding-skills-sample-code •  Compile the main-http application •  g++ -o main-json-lib main-json-lib.cpp -Irapidjson/include –lcurl •  Do something with the returned results •  Like Prettify! Parsing Content via C++ using RapidJSON 45
  • 46. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Activity 5: Extracting Content
  • 47. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  An application that extracts data from the JSON output •  main •  Code available at https://github.com/CiscoDevNet/coding-skills-sample-code •  Compile the main-http application •  g++ -o main main.cpp -Irapidjson/include –lcurl •  Do something with the returned results •  Like Get AccessPoint names from your CMX installation! Parsing Content via C++ using RapidJSON 47
  • 48. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Demo: IOx 48
  • 49. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  IOx •  Edge Computing •  C++ on the Edge •  Cross-Compilation Toolchain •  x86 > PowerPC Demonstration 49
  • 50. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Resources
  • 51. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Resources •  On-Site •  Learning Labs •  https://learninglabs.cisco.com •  DevNetizens Information to help you on your way
  • 52. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ Resources •  On-Line •  Learning Labs •  https://learninglabs.cisco.com •  C++ •  http://www.cplusplus.com/ •  http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list/ •  JSON : JSON.org •  JSON Test : http://www.jsontest.com/ •  JSON Lint : http://jsonlint.com/ •  JSON Placeholder : http://jsonplaceholder.typicode.com/ Information to help you on your way
  • 53. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicCoding 210: Parsing JSON in C++ •  Try it yourself •  Do a Learning Lab •  Go Online •  Read a book Where to go from here? 53
  • 54. Thank you © 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicPresentation ID 54