SlideShare a Scribd company logo
Processing 2.0
+ Open Data
@stevebattle
stevebattle.me
blog.stevebattle.me
processing.freeforums.org
Here’s the plan
1.Access Open Data (weather forecast)
2.Read JSON (JavaScript Object Notation)
3.Graphical widgets (ControlP5)
4.Upload App to mobile device
Access Open Data
• The Met Office have created DataPoint:
http://www.metoffice.gov.uk/datapoint
• Free registration here to get a key:
http://bit.ly/11ApBRT
• All resources have a base URL:
http://datapoint.metoffice.gov.uk/public/data/
• Add resource path and key parameter:
http://datapoint.metoffice.gov.uk/public/data/
RESOURCE?key=XXXX
• Five day forecast for Bristol:
http://datapoint.metoffice.gov.uk/public/data/
val/wxfcs/all/json/310004?res=daily&key=XXXX
• Save this sketch as ‘weather’
• Drag openjson.jar onto the PDE, see:
http://code.google.com/p/battle-bot/downloads/list
JSON http://www.json.org
• Objects {} containing string:value pairs
• Arrays [] of values
• Values can be objects, arrays, strings, numbers,
booleans, or null
{"Locations": {"Location": [
{
"id": "3094",
"name": "Rosehearty Samos",
"longitude": "-2.121",
"latitude": "57.698"
},
...
{
"id": "354552",
"name": "Perranuthnoe (Perran Sands) (Beach)",
"longitude": "-5.4411",
"latitude": "50.1121"
}
]}}
• Use a loop to search JSON for an
object named ‘Bristol’.
Get the five day forecast
{"SiteRep": {
"Wx": {"Param": [
{
"$": "Day Maximum Temperature",
"name": "Dm",
"units": "C"
}, ...
]},
"DV": {
"dataDate": "2013-08-02T21:00:00Z",
"Location": {
"Period": [
{
"value": "2013-08-02Z",
"type": "Day",
"Rep": [
{
"Dm": "24", ...
} ]
}, ... ]
}
"type": "Forecast"
}
}}
The five day forecast
Method chaining
Plan ahead with a sketch
Graphical Widgets
• Sketch > Import Library > Add Library
• Sketch > Import Library > ControlP5
import controlP5.*;
ListBox Widget
public void draw() {
background(255);
fill(0);
}
•Define locationID as global:
String locationID = "310004"; // Bristol
•Replace // Search for ‘Bristol’ code with:
initList(locations);
•Detect the List selection event
to assign locationID
Tab Widgets
• To make the siteList selection happen
before it gets the forecast we’ll put
them on different tabs.
• Move the forecasting code at the end
of setup() into its own function...
...and call the function when the
‘forecast’ tab is selected.
Chart Widget
• Instead of printing the forecast we’ll
plot the temperatures on a chart.
Chart chart;
Modify initForecast()
Upload App
A few minor tweaks are required to run
this as an Android App.
• Switch to ‘Android’ mode.
• You have to give the App permission to
use the internet:
Android > Sketch Permisions > Check INTERNET
App Mods
• Set the size() for the device:
size(displayWidth,displayHeight);
• Optionally change the orientation:
orientation(LANDSCAPE);
• The tab widgets are too small:
cp5.getTab(“default”).setWidth(200).setHeight(40);
cp5.getTab(“forecast”).setWidth(200).setHeight(40);
• The ListBox is too small. Double:
ItemHeight, BarHeight, ScrollBarWidth.
• The font is too small:
PFont pfont = createFont(“Ariel”,20,true);
cp5.setFont(new ControlFont(pfont,24));
Summary
• Decorating the Met Office weather
chart is left as an exercise for the
reader. See controlP5 javadoc:
<http://www.sojamo.de/libraries/controlP5/reference/>
• Try displaying other information in
the forecast, such as the weather
summary (field “W”).
<http://www.metoffice.gov.uk/media/pdf/3/0/DataPoint_API_reference.pdf>
• You now have the technology to create
great open data Apps using Processing
2.0

More Related Content

What's hot

ArcGIS GeoEvent Processor
ArcGIS GeoEvent ProcessorArcGIS GeoEvent Processor
ArcGIS GeoEvent Processor
Esri
 
Customized story map for agrg weather network
Customized story map for agrg weather networkCustomized story map for agrg weather network
Customized story map for agrg weather network
swap0
 
Thesis Final Presentation
Thesis Final PresentationThesis Final Presentation
Thesis Final Presentation
creacher
 
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
GIS in the Rockies
 
Air Pollution in Sofia - Solution through Data Science by Kiwi team
Air Pollution in Sofia - Solution through Data Science by Kiwi teamAir Pollution in Sofia - Solution through Data Science by Kiwi team
Air Pollution in Sofia - Solution through Data Science by Kiwi team
Data Science Society
 
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Jan-Hendrik Kuperus
 
Thermal Analysis in Ecotect
Thermal Analysis in EcotectThermal Analysis in Ecotect
Thermal Analysis in Ecotect
NYCCTfab
 
Data Sources
Data SourcesData Sources
Data Sources
Joe Larson
 
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Databricks
 
Google charts
Google chartsGoogle charts
Google charts
maikroeder
 
Improving Weather Information Data Services with FME
Improving Weather Information Data Services with FMEImproving Weather Information Data Services with FME
Improving Weather Information Data Services with FME
Safe Software
 
MapMap-Reduce recipes in with c#
MapMap-Reduce recipes in with c#MapMap-Reduce recipes in with c#
MapMap-Reduce recipes in with c#Erik Lebel
 
Hydrology TEP Flood Mapping Quick Guide
Hydrology TEP Flood Mapping Quick GuideHydrology TEP Flood Mapping Quick Guide
Hydrology TEP Flood Mapping Quick Guide
Emmanuel Mathot
 
Ecotect Presentaion
Ecotect PresentaionEcotect Presentaion
Ecotect Presentaion
Matthew Combe
 
GEP Diapason services for differential interferograms generation
GEP Diapason services for differential interferograms generationGEP Diapason services for differential interferograms generation
GEP Diapason services for differential interferograms generation
Emmanuel Mathot
 
[Year 2012-13] Wimax
[Year 2012-13] Wimax[Year 2012-13] Wimax
[Year 2012-13] Wimax
Saurabh N. Mehta
 
Surveying GeoNames Gazetteer Data for the Nordic Countries
Surveying GeoNames Gazetteer Data for the Nordic CountriesSurveying GeoNames Gazetteer Data for the Nordic Countries
Surveying GeoNames Gazetteer Data for the Nordic Countries
Dirk Ahlers
 

What's hot (20)

ArcGIS GeoEvent Processor
ArcGIS GeoEvent ProcessorArcGIS GeoEvent Processor
ArcGIS GeoEvent Processor
 
Customized story map for agrg weather network
Customized story map for agrg weather networkCustomized story map for agrg weather network
Customized story map for agrg weather network
 
Thesis Final Presentation
Thesis Final PresentationThesis Final Presentation
Thesis Final Presentation
 
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
2013 Vendor Track, ArcGIS GeoEvent Processor by Jayson Hagen
 
510p3saleh
510p3saleh510p3saleh
510p3saleh
 
Air Pollution in Sofia - Solution through Data Science by Kiwi team
Air Pollution in Sofia - Solution through Data Science by Kiwi teamAir Pollution in Sofia - Solution through Data Science by Kiwi team
Air Pollution in Sofia - Solution through Data Science by Kiwi team
 
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
Real Life Event Sourcing with Axon Framework (Meetup Jan 2018)
 
Thermal Analysis in Ecotect
Thermal Analysis in EcotectThermal Analysis in Ecotect
Thermal Analysis in Ecotect
 
Data Sources
Data SourcesData Sources
Data Sources
 
google chart
google chartgoogle chart
google chart
 
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
Geospatial Analytics at Scale: Analyzing Human Movement Patterns During a Pan...
 
Google charts
Google chartsGoogle charts
Google charts
 
Improving Weather Information Data Services with FME
Improving Weather Information Data Services with FMEImproving Weather Information Data Services with FME
Improving Weather Information Data Services with FME
 
Dent
DentDent
Dent
 
MapMap-Reduce recipes in with c#
MapMap-Reduce recipes in with c#MapMap-Reduce recipes in with c#
MapMap-Reduce recipes in with c#
 
Hydrology TEP Flood Mapping Quick Guide
Hydrology TEP Flood Mapping Quick GuideHydrology TEP Flood Mapping Quick Guide
Hydrology TEP Flood Mapping Quick Guide
 
Ecotect Presentaion
Ecotect PresentaionEcotect Presentaion
Ecotect Presentaion
 
GEP Diapason services for differential interferograms generation
GEP Diapason services for differential interferograms generationGEP Diapason services for differential interferograms generation
GEP Diapason services for differential interferograms generation
 
[Year 2012-13] Wimax
[Year 2012-13] Wimax[Year 2012-13] Wimax
[Year 2012-13] Wimax
 
Surveying GeoNames Gazetteer Data for the Nordic Countries
Surveying GeoNames Gazetteer Data for the Nordic CountriesSurveying GeoNames Gazetteer Data for the Nordic Countries
Surveying GeoNames Gazetteer Data for the Nordic Countries
 

Viewers also liked

ぼくの実装した最弱のディープラーニング
ぼくの実装した最弱のディープラーニングぼくの実装した最弱のディープラーニング
ぼくの実装した最弱のディープラーニング
なおき きしだ
 
Chainerチュートリアル -v1.5向け- ViEW2015
Chainerチュートリアル -v1.5向け- ViEW2015Chainerチュートリアル -v1.5向け- ViEW2015
Chainerチュートリアル -v1.5向け- ViEW2015
Ryosuke Okuta
 
Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識
Ken Morishita
 
Deep Learningと画像認識   ~歴史・理論・実践~
Deep Learningと画像認識 ~歴史・理論・実践~Deep Learningと画像認識 ~歴史・理論・実践~
Deep Learningと画像認識   ~歴史・理論・実践~
nlab_utokyo
 
自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning自然言語処理のためのDeep Learning
自然言語処理のためのDeep LearningYuta Kikuchi
 
TensorFlow を使った 機械学習ことはじめ (GDG京都 機械学習勉強会)
TensorFlow を使った機械学習ことはじめ (GDG京都 機械学習勉強会)TensorFlow を使った機械学習ことはじめ (GDG京都 機械学習勉強会)
TensorFlow を使った 機械学習ことはじめ (GDG京都 機械学習勉強会)
徹 上野山
 
機械学習概論 講義テキスト
機械学習概論 講義テキスト機械学習概論 講義テキスト
機械学習概論 講義テキスト
Etsuji Nakai
 
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築Tatsuya Tojima
 
機械学習チュートリアル@Jubatus Casual Talks
機械学習チュートリアル@Jubatus Casual Talks機械学習チュートリアル@Jubatus Casual Talks
機械学習チュートリアル@Jubatus Casual TalksYuya Unno
 
機械学習によるデータ分析まわりのお話
機械学習によるデータ分析まわりのお話機械学習によるデータ分析まわりのお話
機械学習によるデータ分析まわりのお話
Ryota Kamoshida
 
scikit-learnを用いた機械学習チュートリアル
scikit-learnを用いた機械学習チュートリアルscikit-learnを用いた機械学習チュートリアル
scikit-learnを用いた機械学習チュートリアル
敦志 金谷
 

Viewers also liked (11)

ぼくの実装した最弱のディープラーニング
ぼくの実装した最弱のディープラーニングぼくの実装した最弱のディープラーニング
ぼくの実装した最弱のディープラーニング
 
Chainerチュートリアル -v1.5向け- ViEW2015
Chainerチュートリアル -v1.5向け- ViEW2015Chainerチュートリアル -v1.5向け- ViEW2015
Chainerチュートリアル -v1.5向け- ViEW2015
 
Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識
 
Deep Learningと画像認識   ~歴史・理論・実践~
Deep Learningと画像認識 ~歴史・理論・実践~Deep Learningと画像認識 ~歴史・理論・実践~
Deep Learningと画像認識   ~歴史・理論・実践~
 
自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning
 
TensorFlow を使った 機械学習ことはじめ (GDG京都 機械学習勉強会)
TensorFlow を使った機械学習ことはじめ (GDG京都 機械学習勉強会)TensorFlow を使った機械学習ことはじめ (GDG京都 機械学習勉強会)
TensorFlow を使った 機械学習ことはじめ (GDG京都 機械学習勉強会)
 
機械学習概論 講義テキスト
機械学習概論 講義テキスト機械学習概論 講義テキスト
機械学習概論 講義テキスト
 
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
Tokyo.R 41 サポートベクターマシンで眼鏡っ娘分類システム構築
 
機械学習チュートリアル@Jubatus Casual Talks
機械学習チュートリアル@Jubatus Casual Talks機械学習チュートリアル@Jubatus Casual Talks
機械学習チュートリアル@Jubatus Casual Talks
 
機械学習によるデータ分析まわりのお話
機械学習によるデータ分析まわりのお話機械学習によるデータ分析まわりのお話
機械学習によるデータ分析まわりのお話
 
scikit-learnを用いた機械学習チュートリアル
scikit-learnを用いた機械学習チュートリアルscikit-learnを用いた機械学習チュートリアル
scikit-learnを用いた機械学習チュートリアル
 

Similar to Processing 2.0 + Open Data

GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
mharkus
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
NgLQun
 
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
Sébastien Levert
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!
BIWUG
 
SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!
Sébastien Levert
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 seriesopenbala
 
@Ionic native/google-maps
@Ionic native/google-maps@Ionic native/google-maps
@Ionic native/google-maps
Masashi Katsumata
 
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
Sébastien Levert
 
Map
MapMap
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
Erhwen Kuo
 
Phone Gap
Phone GapPhone Gap
Phone Gap
Yiguang Hu
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCJim Tochterman
 
Howtomakeyourown gi sdashboard
Howtomakeyourown gi sdashboardHowtomakeyourown gi sdashboard
Howtomakeyourown gi sdashboard
GeoMedeelel
 
Full Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey DiagramFull Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey Diagram
Neo4j
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
karthikaparthasarath
 
Build Location Based App on bada
Build Location Based App on badaBuild Location Based App on bada
Build Location Based App on bada
Cheng Luo
 
Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5
Chris Griffith
 
Leveraging Geographic Data in SugarCRM
Leveraging Geographic Data in SugarCRMLeveraging Geographic Data in SugarCRM
Leveraging Geographic Data in SugarCRM
Asa Kusuma
 

Similar to Processing 2.0 + Open Data (20)

GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
 
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!
 
SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 series
 
@Ionic native/google-maps
@Ionic native/google-maps@Ionic native/google-maps
@Ionic native/google-maps
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
Global mapperhelp
Global mapperhelpGlobal mapperhelp
Global mapperhelp
 
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
 
Map
MapMap
Map
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
 
Phone Gap
Phone GapPhone Gap
Phone Gap
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
 
Howtomakeyourown gi sdashboard
Howtomakeyourown gi sdashboardHowtomakeyourown gi sdashboard
Howtomakeyourown gi sdashboard
 
Full Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey DiagramFull Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey Diagram
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
 
Build Location Based App on bada
Build Location Based App on badaBuild Location Based App on bada
Build Location Based App on bada
 
Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5
 
Leveraging Geographic Data in SugarCRM
Leveraging Geographic Data in SugarCRMLeveraging Geographic Data in SugarCRM
Leveraging Geographic Data in SugarCRM
 

More from Steven Battle

Digital Storytelling with Twine
Digital Storytelling with TwineDigital Storytelling with Twine
Digital Storytelling with Twine
Steven Battle
 
Coding Chinese Dragons
Coding Chinese DragonsCoding Chinese Dragons
Coding Chinese Dragons
Steven Battle
 
Coding with Counting Songs: “Ten Green Bottles” in Python
Coding with Counting Songs: “Ten Green Bottles”  in PythonCoding with Counting Songs: “Ten Green Bottles”  in Python
Coding with Counting Songs: “Ten Green Bottles” in Python
Steven Battle
 
Droid Geometry
Droid GeometryDroid Geometry
Droid Geometry
Steven Battle
 
Squishy logic
Squishy logicSquishy logic
Squishy logic
Steven Battle
 
Ashby's Mobile homeostat
Ashby's Mobile homeostatAshby's Mobile homeostat
Ashby's Mobile homeostat
Steven Battle
 
Turtle Geometry the Python Way
Turtle Geometry the Python WayTurtle Geometry the Python Way
Turtle Geometry the Python Way
Steven Battle
 
Quick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture EvaluationQuick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture Evaluation
Steven Battle
 
Autaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural VehiclesAutaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural Vehicles
Steven Battle
 
The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2
Steven Battle
 
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Steven Battle
 
Robots Are GO!
Robots Are GO!Robots Are GO!
Robots Are GO!
Steven Battle
 
Adventures in ARM Assembler
Adventures in ARM AssemblerAdventures in ARM Assembler
Adventures in ARM Assembler
Steven Battle
 
Ecore Model Reflection in RDF
Ecore Model Reflection in RDFEcore Model Reflection in RDF
Ecore Model Reflection in RDF
Steven Battle
 
Introduction to App Development with Processing 2
Introduction to App Development with Processing 2Introduction to App Development with Processing 2
Introduction to App Development with Processing 2
Steven Battle
 
CycQL: A SPARQL Adapter for OpenCyc
CycQL: A SPARQL Adapter for OpenCycCycQL: A SPARQL Adapter for OpenCyc
CycQL: A SPARQL Adapter for OpenCyc
Steven Battle
 

More from Steven Battle (16)

Digital Storytelling with Twine
Digital Storytelling with TwineDigital Storytelling with Twine
Digital Storytelling with Twine
 
Coding Chinese Dragons
Coding Chinese DragonsCoding Chinese Dragons
Coding Chinese Dragons
 
Coding with Counting Songs: “Ten Green Bottles” in Python
Coding with Counting Songs: “Ten Green Bottles”  in PythonCoding with Counting Songs: “Ten Green Bottles”  in Python
Coding with Counting Songs: “Ten Green Bottles” in Python
 
Droid Geometry
Droid GeometryDroid Geometry
Droid Geometry
 
Squishy logic
Squishy logicSquishy logic
Squishy logic
 
Ashby's Mobile homeostat
Ashby's Mobile homeostatAshby's Mobile homeostat
Ashby's Mobile homeostat
 
Turtle Geometry the Python Way
Turtle Geometry the Python WayTurtle Geometry the Python Way
Turtle Geometry the Python Way
 
Quick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture EvaluationQuick & Dirty Model-Driven Architecture Evaluation
Quick & Dirty Model-Driven Architecture Evaluation
 
Autaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural VehiclesAutaptic Circuits for Neural Vehicles
Autaptic Circuits for Neural Vehicles
 
The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2The Animated Android: Graphical Animation in Processing 2
The Animated Android: Graphical Animation in Processing 2
 
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
Blitz Resurrection: Re-creating a classic 80s video game in Processing 2
 
Robots Are GO!
Robots Are GO!Robots Are GO!
Robots Are GO!
 
Adventures in ARM Assembler
Adventures in ARM AssemblerAdventures in ARM Assembler
Adventures in ARM Assembler
 
Ecore Model Reflection in RDF
Ecore Model Reflection in RDFEcore Model Reflection in RDF
Ecore Model Reflection in RDF
 
Introduction to App Development with Processing 2
Introduction to App Development with Processing 2Introduction to App Development with Processing 2
Introduction to App Development with Processing 2
 
CycQL: A SPARQL Adapter for OpenCyc
CycQL: A SPARQL Adapter for OpenCycCycQL: A SPARQL Adapter for OpenCyc
CycQL: A SPARQL Adapter for OpenCyc
 

Recently uploaded

Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 

Recently uploaded (20)

Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 

Processing 2.0 + Open Data

  • 1. Processing 2.0 + Open Data @stevebattle stevebattle.me blog.stevebattle.me processing.freeforums.org
  • 2. Here’s the plan 1.Access Open Data (weather forecast) 2.Read JSON (JavaScript Object Notation) 3.Graphical widgets (ControlP5) 4.Upload App to mobile device
  • 3. Access Open Data • The Met Office have created DataPoint: http://www.metoffice.gov.uk/datapoint • Free registration here to get a key: http://bit.ly/11ApBRT • All resources have a base URL: http://datapoint.metoffice.gov.uk/public/data/ • Add resource path and key parameter: http://datapoint.metoffice.gov.uk/public/data/ RESOURCE?key=XXXX • Five day forecast for Bristol: http://datapoint.metoffice.gov.uk/public/data/ val/wxfcs/all/json/310004?res=daily&key=XXXX
  • 4. • Save this sketch as ‘weather’ • Drag openjson.jar onto the PDE, see: http://code.google.com/p/battle-bot/downloads/list
  • 5. JSON http://www.json.org • Objects {} containing string:value pairs • Arrays [] of values • Values can be objects, arrays, strings, numbers, booleans, or null {"Locations": {"Location": [ { "id": "3094", "name": "Rosehearty Samos", "longitude": "-2.121", "latitude": "57.698" }, ... { "id": "354552", "name": "Perranuthnoe (Perran Sands) (Beach)", "longitude": "-5.4411", "latitude": "50.1121" } ]}}
  • 6. • Use a loop to search JSON for an object named ‘Bristol’.
  • 7. Get the five day forecast
  • 8. {"SiteRep": { "Wx": {"Param": [ { "$": "Day Maximum Temperature", "name": "Dm", "units": "C" }, ... ]}, "DV": { "dataDate": "2013-08-02T21:00:00Z", "Location": { "Period": [ { "value": "2013-08-02Z", "type": "Day", "Rep": [ { "Dm": "24", ... } ] }, ... ] } "type": "Forecast" } }} The five day forecast
  • 10. Plan ahead with a sketch
  • 11. Graphical Widgets • Sketch > Import Library > Add Library • Sketch > Import Library > ControlP5 import controlP5.*;
  • 12. ListBox Widget public void draw() { background(255); fill(0); }
  • 13. •Define locationID as global: String locationID = "310004"; // Bristol •Replace // Search for ‘Bristol’ code with: initList(locations);
  • 14.
  • 15. •Detect the List selection event to assign locationID
  • 16. Tab Widgets • To make the siteList selection happen before it gets the forecast we’ll put them on different tabs.
  • 17. • Move the forecasting code at the end of setup() into its own function...
  • 18. ...and call the function when the ‘forecast’ tab is selected.
  • 19. Chart Widget • Instead of printing the forecast we’ll plot the temperatures on a chart. Chart chart;
  • 21. Upload App A few minor tweaks are required to run this as an Android App. • Switch to ‘Android’ mode. • You have to give the App permission to use the internet: Android > Sketch Permisions > Check INTERNET
  • 22. App Mods • Set the size() for the device: size(displayWidth,displayHeight); • Optionally change the orientation: orientation(LANDSCAPE); • The tab widgets are too small: cp5.getTab(“default”).setWidth(200).setHeight(40); cp5.getTab(“forecast”).setWidth(200).setHeight(40); • The ListBox is too small. Double: ItemHeight, BarHeight, ScrollBarWidth. • The font is too small: PFont pfont = createFont(“Ariel”,20,true); cp5.setFont(new ControlFont(pfont,24));
  • 23.
  • 24. Summary • Decorating the Met Office weather chart is left as an exercise for the reader. See controlP5 javadoc: <http://www.sojamo.de/libraries/controlP5/reference/> • Try displaying other information in the forecast, such as the weather summary (field “W”). <http://www.metoffice.gov.uk/media/pdf/3/0/DataPoint_API_reference.pdf> • You now have the technology to create great open data Apps using Processing 2.0