Politics Ain’t Beanbag:
Using APEX, ML, and GeoCoding
In a Modern Election Campaign
Jim Czuprynski
@JimTheWhyGuy
My Credentials
• 40 years of database-centric IT experience
• Oracle DBA since 2001
• Oracle 9i, 10g, 11g, 12c OCP and ADWC
• Oracle ACE Director since 2014
• ODTUG Database Committee Lead
• Editor of ODTUG TechCeleration
• Oracle-centric blog (Generally, It Depends)
• Regular speaker at Oracle OpenWorld, COLLABORATE,
KSCOPE, and international and regional OUGs
E-mail me at jczuprynski@zerodefectcomputing.com
Follow me on Twitter (@JimTheWhyGuy)
Connect with me on LinkedIn (Jim Czuprynski)
ATP, Machine Learning, and APEX:
Benefits and Synergies
APEX, AI, and ML: Where Analytic Magic Happens
Application Express (APEX) makes it trivial to
instantly import data and business
applications directly into Oracle … even if it’s
just resident within a simple spreadsheet
Oracle’s REST API enables quick
development of complex data
entry and reporting applications
within APEX in a low-code
environment
Once relevant data is captured,
Oracle’s built-in data mining tools
make is simple to build data models,
apply well-known algorithms, and
obtain predictions for immediate
business insights
Specialization Is Dead. Long Live the Generalist.
Compared to other scientists, Nobel laureates
are at least twenty-two times more likely to
partake as an amateur actor, dancer,
magician, or other type of performer.
- David J. Epstein. Range (p. 33).
“We now have the [enemy] exactly
where we want them. We can now
attack in any direction.”
- Brigadier General Anthony C. “Nuts” McAuliffe
Data is the new oil, and its miners are
data scientists … but DBAs are uniquely
positioned to support them
All images from
images.google.com
The Converged Database: A Vision for the Future, 20c and Beyond
Personal / External
Datasets
Enterprise Applications
Data Integration
OAC, OML,
and APEX
Ad hoc,
Batch or
Scheduled
Business
Leaders
Analysts
Data
Scientists
Developers
OAC Dataflow,
Manual or ETL
Data Management
ADW or ATP
Business Analytics
ERP CRM HCM
Self-sufficient,
encrypted, secured
data storehouse
Self-service
analytics via ML
REST-Enabled
External APIs
VEVO 2.0: (Re)building the APEX Application Framework
• VEV0 1.0: My “Hello World!” APEX Application
• VEVO 2.0: A New Campaign. New Requirements.
VEVO 1.0: An (Extremely!) Basic Desktop Application
•Campaign organization management
•Canvassing progress
•Campaign organization staff’s hierarchy
•Canvassing coverage within geographic areas
VEVO Desktop: Campaign Overviews, Drill-Downs, and Details
Reviewing voter canvassing progress
1
VEVO Desktop: Campaign Overviews, Drill-Downs, and Details
Viewing the campaign staff hierarchy and
work completed so far
3
Not only does this
provide the hierarchical
structure of the staff …
… but it gives key Committee
Leads see what their
Canvassing Organizers are
working on …
… and Canvassing
Organizers can review
the combined results
of her team …
… as well as
Volunteer’s individual
achievements!
MobileVEVO: Deploying A Basic Mobile Application
Canvassers in the field needed to:
•Find which voters haven’t yet been canvassed
•See voters’ details while canvassing
•Record voter sentiment towards candidate
•Mark off voters already contacted
MobileVEVO: Easy to Build. Easy to Use.
The canvasser self-assigns …
1 .. and gets assigned a random
list of voters to canvass …
2
… and then the canvasser records detailed information about
the voter’s proclivities towards the candidate and campaign.
3
VEVO 2.0: A New Election Campaign, With Some New Requirements
14
Identify potential voters, including
“flippability” since 2018 election
Analyze results of voter outreach
Deploy multitudes of volunteers
for maximum efficiency
VEVO 2.0: Perfect for Autonomous DB Always-Free.
15
•Centralized data management, consistent processes
•Simple data model, smallish data volume
•Machine Learning, Analytics, and GIS features are
crucial
•Security is a must!
Just because you’re paranoid
doesn’t mean they’re not out to get you.
- Anonymous
Politics ain’t bean-bag.
- Harold Washington, Chicago’s 1st African-American Mayor
Bringing Code to Data, Not the Other Way Around
• Loading Data from External Sources with APEX_DATA_PARSER
• Leveraging Web Source Modules
Capturing Campaign Merchandising Data From External Sources
This page allows retrieval, review, and
eventual loading of data stored within
Microsoft Excel spreadsheets
1
If there are more than one sheets in the
incoming XLSX workbook, each sheet’s
contents can be processed separately
2
Web Source Modules: Leave the Data Where It Lives
Web Source Modules let you access vast amounts of
external data via REST API calls
1
Here we’re using the MapQuest GeoCoding API
to retrieve Latitude, Longitude, and other
specific GIS information for a single address
2 The REST API call requires an API
key as well as a compressed, single-
field version for each address
3
Implementing a Web Source Module
DECLARE
wsm_context APEX_EXEC.T_CONTEXT;
wsm_parameters APEX_EXEC.T_PARAMETERS;
l_locidx PLS_INTEGER;
l_gisidx PLS_INTEGER;
l_latidx PLS_INTEGER;
l_lngidx PLS_INTEGER;
l_sosidx PLS_INTEGER;
vcGISQualityCode VARCHAR2(6);
nLatitude NUMBER;
nLongitude NUMBER;
vcLocation VARCHAR2(100);
vcSideOfStreet VARCHAR2(1);
. . .
Basic set-up …
. . .
BEGIN
-- Describe parameters
APEX_EXEC.ADD_PARAMETER (
p_parameters => wsm_parameters
,p_name => 'location'
,p_value => :P135_LOCATION);
-- Open Web Source
wsm_context :=
APEX_EXEC.OPEN_WEB_SOURCE_QUERY (
p_module_static_id => 'MQSingleAddress'
,p_parameters => wsm_parameters);
-- Retrieve return parameters based on their returned arguments
l_locidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'LOCATION');
l_latidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'Latitude');
l_lngidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'Longitude');
l_gisidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'GIS_QualityCode');
l_sosidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'SideOfStreet');
. . .
Opening the web
source …
… and posting the retrieved
results to variables
. . .
-- Loop thru returned values in the WSM result set
WHILE APEX_EXEC.NEXT_ROW (wsm_context)
LOOP
IF APEX_EXEC.GET_VARCHAR2 (wsm_context, l_locidx) IS NULL THEN
:P135_LATITUDE := NULL;
:P135_LONGITUDE := NULL;
:P135_QUALITYCODE := 'N/F!!';
:P135_SIDEOFSTREET := NULL;
ELSE
:P135_LATITUDE := APEX_EXEC.GET_NUMBER(wsm_context, l_latidx);
:P135_LONGITUDE := APEX_EXEC.GET_NUMBER(wsm_context, l_lngidx);
:P135_QUALITYCODE := APEX_EXEC.GET_VARCHAR2(wsm_context, l_gisidx);
:P135_SIDEOFSTREET := APEX_EXEC.GET_VARCHAR2(wsm_context, l_sosidx);
END IF;
END LOOP;
-- Close Web Source
APEX_EXEC.CLOSE (wsm_context);
EXCEPTION
WHEN OTHERS THEN
-- Close Web Source
APEX_EXEC.CLOSE (wsm_context);
END;
Loop thru all returned
values, setting them as
page variables
Complex Web Source Module Requests? APEX Packages to the Rescue!
This works fine when we
need just a single set of
values returned …
. . .
BEGIN
-----
-- Create a CLOB containing the necessary address elements
-----
APEX_JSON.INITIALIZE_CLOB_OUTPUT;
APEX_JSON.OPEN_OBJECT;
FOR i IN curNeedLatLng
LOOP
APEX_JSON.WRITE(i.van_id, i.formatted_address);
END LOOP;
APEX_JSON.CLOSE_OBJECT;
sent_clob := APEX_JSON.GET_CLOB_OUTPUT;
APEX_JSON.FREE_OUTPUT;
. . .
… but consider leveraging
APEX_JSON to create, submit,
receive, and interpret large
volume batch requests instead …
. . .
APEX_WEB_SERVICE.G_REQUEST_HEADERS.DELETE();
APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).name := 'Content-Type';
APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).value := 'application/json';
recv_clob :=
APEX_WEB_SERVICE.MAKE_REST_REQUEST(
p_url => 'https://api.geocod.io/v1.6/geocode?api_key=ofe…^$#@%^&$#@...ee5'
,p_http_method => 'POST'
,p_body => sent_clob
);
. . .
… and calling WSMs with APEX_WEB_SERVICE
when complex processing and formatting of
JSON or XML is required
(Campaign) Signs and (Electoral) Portents
• Visualizing Machine Learning Algorithms
• APEX Google Map Plug-Ins
Application Express (APEX) and ML / Analytics: A Most Excellent Pairing!
22
•Accesses same schema objects that Oracle Machine
Learning (OML) and Oracle Analytic Cloud (OAC) already
use
•Powerful reporting and graphic toolsets
•Seamless integration with Autonomous DB (ATP & ADW)
APEX’s extensive and flexible application development capabilities
pair nicely with ML algorithms and analytic reporting techniques
Leveraging Google Map Plug-In Features
Post-installation of Jeffery Kemp’s Google Maps API Plug-in
1
Build a query to add points on a Google Map
2
Controlling Google Map
behavior and attributes
3
Voila! Google Maps for Merchandise and Sign Distribution
Get Jeffrey Kemp’s excellent Google Map Plug-ins: https://jeffkemponoracle.com/2016/02/google-map-apex-
plugins/
This is an extremely simple
example of the power behind
this plug-in!
Just about any feature of
Google Maps can be exploited,
including distancing, routing,
and directions
Useful Resources and Documentation
• APEX_DATA_PARSER Implementation Examples:
https://blogs.oracle.com/apex/super-easy-csv-xlsx-json-or-xml-parsing-about-the-apex_data_parser-
package
• APEX_JSON Examples:
https://jsao.io/2015/07/relational-to-json-with-apex_json/
• Jeffrey Kemp’s Google Maps APEX Plug-ins:
https://jeffkemponoracle.com/2016/02/google-map-apex-plugins/
https://jeffkemponoracle.com/tag/apex-plugins/
https://github.com/jeffreykemp/jk64-plugin-reportmap/wiki/SQL-Query-Examples
• OML “Cheat Sheet”:
https://www.oracle.com/a/tech/docs/oml4sql-algorithm-cheat-sheet-19c-v2.pdf

More Related Content

PPSX
What's Your Super-Power? Mine is Machine Learning with Oracle Autonomous DB.
PPSX
An Autonomous Singularity Approaches: Force Multipliers For Overwhelmed DBAs
PPSX
Fast and Furious: Handling Edge Computing Data With Oracle 19c Fast Ingest an...
PPTX
Oracle Autonomous Database for Developers
PDF
20 tips and tricks with the Autonomous Database
PDF
Top 20 FAQs on the Autonomous Database
PPTX
#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...
PDF
Introduction to Machine Learning for Oracle Database Professionals
What's Your Super-Power? Mine is Machine Learning with Oracle Autonomous DB.
An Autonomous Singularity Approaches: Force Multipliers For Overwhelmed DBAs
Fast and Furious: Handling Edge Computing Data With Oracle 19c Fast Ingest an...
Oracle Autonomous Database for Developers
20 tips and tricks with the Autonomous Database
Top 20 FAQs on the Autonomous Database
#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...
Introduction to Machine Learning for Oracle Database Professionals

What's hot (20)

PPTX
Incredible ODI tips to work with Hyperion tools that you ever wanted to know
PPTX
Azure Databricks is Easier Than You Think
PPTX
JSON and the Oracle Database
PDF
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Fea...
PDF
Database@Home : The Future is Data Driven
PDF
Database Cloud Services Office Hours : Oracle sharding hyperscale globally d...
PDF
Essbase Statistics DW: How to Automatically Administrate Essbase Using ODI
PDF
Spark For Faster Batch Processing
PPTX
How to solve complex business requirements with Oracle Data Integrator?
DOCX
markfinleyResumeMarch2016
PDF
Radical Speed for SQL Queries on Databricks: Photon Under the Hood
PDF
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
PDF
MySQL Sharding: Tools and Best Practices for Horizontal Scaling
PDF
Data Warehouse 2.0: Master Techniques for EPM Guys (Powered by ODI)
PPTX
Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...
PPTX
Dive Into Azure Data Lake - PASS 2017
PPTX
How Concur uses Big Data to get you to Tableau Conference On Time
PPTX
Take a peek at Dell's smart EPM global environment
PPTX
Beginners guide to_optimizer
PPTX
Apache MetaModel - unified access to all your data points
Incredible ODI tips to work with Hyperion tools that you ever wanted to know
Azure Databricks is Easier Than You Think
JSON and the Oracle Database
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Fea...
Database@Home : The Future is Data Driven
Database Cloud Services Office Hours : Oracle sharding hyperscale globally d...
Essbase Statistics DW: How to Automatically Administrate Essbase Using ODI
Spark For Faster Batch Processing
How to solve complex business requirements with Oracle Data Integrator?
markfinleyResumeMarch2016
Radical Speed for SQL Queries on Databricks: Photon Under the Hood
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
MySQL Sharding: Tools and Best Practices for Horizontal Scaling
Data Warehouse 2.0: Master Techniques for EPM Guys (Powered by ODI)
Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...
Dive Into Azure Data Lake - PASS 2017
How Concur uses Big Data to get you to Tableau Conference On Time
Take a peek at Dell's smart EPM global environment
Beginners guide to_optimizer
Apache MetaModel - unified access to all your data points
Ad

Similar to Politics Ain’t Beanbag: Using APEX, ML, and GeoCoding In a Modern Election Campaign (20)

PPSX
Vote Early, Vote Often: From Napkin to Canvassing Application in a Single Wee...
PPTX
SQL to NoSQL: Top 6 Questions
PDF
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
PDF
Apex Code Analysis Using the Tooling API and Canvas
PPT
Intro to Application Express
PPTX
Oracle application express ppt
PDF
Oracle restful api & data live charting by Oracle Apex - داشبورد آنلاین (داده...
PPTX
Oracle application express
PDF
Rest - Representational State Transfer (EMC BRDC Internal Tech talk)
PPTX
My Saminar On Php
PDF
Setup_Steps_ASCP_1.pdf
PDF
Step-by-Step: APEX Installation on Tomcat (Windows Server 2016)
PPTX
Oracle Apex Intoduction.pptx
PPTX
Oracle Apex Technical Introduction
PPT
Daniel Egan Msdn Tech Days Oc
PPTX
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
PDF
APEX Boston Meetup - October 1st, 2019
PDF
Pretius Oracle Apex Primer
PDF
Offline strategies for HTML5 web applications - pfCongres2012
PDF
DevOps LA Meetup Intro to Habitat
Vote Early, Vote Often: From Napkin to Canvassing Application in a Single Wee...
SQL to NoSQL: Top 6 Questions
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
Apex Code Analysis Using the Tooling API and Canvas
Intro to Application Express
Oracle application express ppt
Oracle restful api & data live charting by Oracle Apex - داشبورد آنلاین (داده...
Oracle application express
Rest - Representational State Transfer (EMC BRDC Internal Tech talk)
My Saminar On Php
Setup_Steps_ASCP_1.pdf
Step-by-Step: APEX Installation on Tomcat (Windows Server 2016)
Oracle Apex Intoduction.pptx
Oracle Apex Technical Introduction
Daniel Egan Msdn Tech Days Oc
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
APEX Boston Meetup - October 1st, 2019
Pretius Oracle Apex Primer
Offline strategies for HTML5 web applications - pfCongres2012
DevOps LA Meetup Intro to Habitat
Ad

More from Jim Czuprynski (13)

PDF
From DBA to DE: Becoming a Data Engineer
PDF
Going Native: Leveraging the New JSON Native Datatype in Oracle 21c
PDF
Access Denied: Real-World Use Cases for APEX and Real Application Security
PDF
Charge Me Up! Using Oracle ML, Analytics, and APEX For Finding Optimal Charge...
PDF
Graphing Grifters: Identify & Display Patterns of Corruption With Oracle Graph
PPSX
So an Airline Pilot, a Urologist, and an IT Technologist Walk Into a Bar: Thi...
PPSX
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
PPSX
Conquer Big Data with Oracle 18c, In-Memory External Tables and Analytic Func...
PPSX
One Less Thing For DBAs to Worry About: Automatic Indexing
PPSX
Keep Your Code Low, Low, Low, Low, Low: Getting to Digitally Driven With Orac...
PPSX
Cluster, Classify, Associate, Regress: Satisfy Your Inner Data Scientist with...
PPSX
Where the %$#^ Is Everybody? Geospatial Solutions For Oracle APEX
PPSX
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...
From DBA to DE: Becoming a Data Engineer
Going Native: Leveraging the New JSON Native Datatype in Oracle 21c
Access Denied: Real-World Use Cases for APEX and Real Application Security
Charge Me Up! Using Oracle ML, Analytics, and APEX For Finding Optimal Charge...
Graphing Grifters: Identify & Display Patterns of Corruption With Oracle Graph
So an Airline Pilot, a Urologist, and an IT Technologist Walk Into a Bar: Thi...
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Conquer Big Data with Oracle 18c, In-Memory External Tables and Analytic Func...
One Less Thing For DBAs to Worry About: Automatic Indexing
Keep Your Code Low, Low, Low, Low, Low: Getting to Digitally Driven With Orac...
Cluster, Classify, Associate, Regress: Satisfy Your Inner Data Scientist with...
Where the %$#^ Is Everybody? Geospatial Solutions For Oracle APEX
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...

Recently uploaded (20)

PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
CloudStack 4.21: First Look Webinar slides
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Architecture types and enterprise applications.pdf
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
Abstractive summarization using multilingual text-to-text transfer transforme...
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
STKI Israel Market Study 2025 version august
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Configure Apache Mutual Authentication
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
The various Industrial Revolutions .pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Custom Battery Pack Design Considerations for Performance and Safety
Hindi spoken digit analysis for native and non-native speakers
CloudStack 4.21: First Look Webinar slides
A contest of sentiment analysis: k-nearest neighbor versus neural network
Developing a website for English-speaking practice to English as a foreign la...
Architecture types and enterprise applications.pdf
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Abstractive summarization using multilingual text-to-text transfer transforme...
Benefits of Physical activity for teenagers.pptx
STKI Israel Market Study 2025 version august
UiPath Agentic Automation session 1: RPA to Agents
Zenith AI: Advanced Artificial Intelligence
Configure Apache Mutual Authentication
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Final SEM Unit 1 for mit wpu at pune .pptx
A proposed approach for plagiarism detection in Myanmar Unicode text
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Taming the Chaos: How to Turn Unstructured Data into Decisions
The various Industrial Revolutions .pptx

Politics Ain’t Beanbag: Using APEX, ML, and GeoCoding In a Modern Election Campaign

  • 1. Politics Ain’t Beanbag: Using APEX, ML, and GeoCoding In a Modern Election Campaign Jim Czuprynski @JimTheWhyGuy
  • 2. My Credentials • 40 years of database-centric IT experience • Oracle DBA since 2001 • Oracle 9i, 10g, 11g, 12c OCP and ADWC • Oracle ACE Director since 2014 • ODTUG Database Committee Lead • Editor of ODTUG TechCeleration • Oracle-centric blog (Generally, It Depends) • Regular speaker at Oracle OpenWorld, COLLABORATE, KSCOPE, and international and regional OUGs E-mail me at jczuprynski@zerodefectcomputing.com Follow me on Twitter (@JimTheWhyGuy) Connect with me on LinkedIn (Jim Czuprynski)
  • 3. ATP, Machine Learning, and APEX: Benefits and Synergies
  • 4. APEX, AI, and ML: Where Analytic Magic Happens Application Express (APEX) makes it trivial to instantly import data and business applications directly into Oracle … even if it’s just resident within a simple spreadsheet Oracle’s REST API enables quick development of complex data entry and reporting applications within APEX in a low-code environment Once relevant data is captured, Oracle’s built-in data mining tools make is simple to build data models, apply well-known algorithms, and obtain predictions for immediate business insights
  • 5. Specialization Is Dead. Long Live the Generalist. Compared to other scientists, Nobel laureates are at least twenty-two times more likely to partake as an amateur actor, dancer, magician, or other type of performer. - David J. Epstein. Range (p. 33). “We now have the [enemy] exactly where we want them. We can now attack in any direction.” - Brigadier General Anthony C. “Nuts” McAuliffe Data is the new oil, and its miners are data scientists … but DBAs are uniquely positioned to support them All images from images.google.com
  • 6. The Converged Database: A Vision for the Future, 20c and Beyond Personal / External Datasets Enterprise Applications Data Integration OAC, OML, and APEX Ad hoc, Batch or Scheduled Business Leaders Analysts Data Scientists Developers OAC Dataflow, Manual or ETL Data Management ADW or ATP Business Analytics ERP CRM HCM Self-sufficient, encrypted, secured data storehouse Self-service analytics via ML REST-Enabled External APIs
  • 7. VEVO 2.0: (Re)building the APEX Application Framework • VEV0 1.0: My “Hello World!” APEX Application • VEVO 2.0: A New Campaign. New Requirements.
  • 8. VEVO 1.0: An (Extremely!) Basic Desktop Application •Campaign organization management •Canvassing progress •Campaign organization staff’s hierarchy •Canvassing coverage within geographic areas
  • 9. VEVO Desktop: Campaign Overviews, Drill-Downs, and Details Reviewing voter canvassing progress 1
  • 10. VEVO Desktop: Campaign Overviews, Drill-Downs, and Details Viewing the campaign staff hierarchy and work completed so far 3 Not only does this provide the hierarchical structure of the staff … … but it gives key Committee Leads see what their Canvassing Organizers are working on … … and Canvassing Organizers can review the combined results of her team … … as well as Volunteer’s individual achievements!
  • 11. MobileVEVO: Deploying A Basic Mobile Application Canvassers in the field needed to: •Find which voters haven’t yet been canvassed •See voters’ details while canvassing •Record voter sentiment towards candidate •Mark off voters already contacted
  • 12. MobileVEVO: Easy to Build. Easy to Use. The canvasser self-assigns … 1 .. and gets assigned a random list of voters to canvass … 2 … and then the canvasser records detailed information about the voter’s proclivities towards the candidate and campaign. 3
  • 13. VEVO 2.0: A New Election Campaign, With Some New Requirements 14 Identify potential voters, including “flippability” since 2018 election Analyze results of voter outreach Deploy multitudes of volunteers for maximum efficiency
  • 14. VEVO 2.0: Perfect for Autonomous DB Always-Free. 15 •Centralized data management, consistent processes •Simple data model, smallish data volume •Machine Learning, Analytics, and GIS features are crucial •Security is a must! Just because you’re paranoid doesn’t mean they’re not out to get you. - Anonymous Politics ain’t bean-bag. - Harold Washington, Chicago’s 1st African-American Mayor
  • 15. Bringing Code to Data, Not the Other Way Around • Loading Data from External Sources with APEX_DATA_PARSER • Leveraging Web Source Modules
  • 16. Capturing Campaign Merchandising Data From External Sources This page allows retrieval, review, and eventual loading of data stored within Microsoft Excel spreadsheets 1 If there are more than one sheets in the incoming XLSX workbook, each sheet’s contents can be processed separately 2
  • 17. Web Source Modules: Leave the Data Where It Lives Web Source Modules let you access vast amounts of external data via REST API calls 1 Here we’re using the MapQuest GeoCoding API to retrieve Latitude, Longitude, and other specific GIS information for a single address 2 The REST API call requires an API key as well as a compressed, single- field version for each address 3
  • 18. Implementing a Web Source Module DECLARE wsm_context APEX_EXEC.T_CONTEXT; wsm_parameters APEX_EXEC.T_PARAMETERS; l_locidx PLS_INTEGER; l_gisidx PLS_INTEGER; l_latidx PLS_INTEGER; l_lngidx PLS_INTEGER; l_sosidx PLS_INTEGER; vcGISQualityCode VARCHAR2(6); nLatitude NUMBER; nLongitude NUMBER; vcLocation VARCHAR2(100); vcSideOfStreet VARCHAR2(1); . . . Basic set-up … . . . BEGIN -- Describe parameters APEX_EXEC.ADD_PARAMETER ( p_parameters => wsm_parameters ,p_name => 'location' ,p_value => :P135_LOCATION); -- Open Web Source wsm_context := APEX_EXEC.OPEN_WEB_SOURCE_QUERY ( p_module_static_id => 'MQSingleAddress' ,p_parameters => wsm_parameters); -- Retrieve return parameters based on their returned arguments l_locidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'LOCATION'); l_latidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'Latitude'); l_lngidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'Longitude'); l_gisidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'GIS_QualityCode'); l_sosidx := APEX_EXEC.GET_COLUMN_POSITION (wsm_context, 'SideOfStreet'); . . . Opening the web source … … and posting the retrieved results to variables . . . -- Loop thru returned values in the WSM result set WHILE APEX_EXEC.NEXT_ROW (wsm_context) LOOP IF APEX_EXEC.GET_VARCHAR2 (wsm_context, l_locidx) IS NULL THEN :P135_LATITUDE := NULL; :P135_LONGITUDE := NULL; :P135_QUALITYCODE := 'N/F!!'; :P135_SIDEOFSTREET := NULL; ELSE :P135_LATITUDE := APEX_EXEC.GET_NUMBER(wsm_context, l_latidx); :P135_LONGITUDE := APEX_EXEC.GET_NUMBER(wsm_context, l_lngidx); :P135_QUALITYCODE := APEX_EXEC.GET_VARCHAR2(wsm_context, l_gisidx); :P135_SIDEOFSTREET := APEX_EXEC.GET_VARCHAR2(wsm_context, l_sosidx); END IF; END LOOP; -- Close Web Source APEX_EXEC.CLOSE (wsm_context); EXCEPTION WHEN OTHERS THEN -- Close Web Source APEX_EXEC.CLOSE (wsm_context); END; Loop thru all returned values, setting them as page variables
  • 19. Complex Web Source Module Requests? APEX Packages to the Rescue! This works fine when we need just a single set of values returned … . . . BEGIN ----- -- Create a CLOB containing the necessary address elements ----- APEX_JSON.INITIALIZE_CLOB_OUTPUT; APEX_JSON.OPEN_OBJECT; FOR i IN curNeedLatLng LOOP APEX_JSON.WRITE(i.van_id, i.formatted_address); END LOOP; APEX_JSON.CLOSE_OBJECT; sent_clob := APEX_JSON.GET_CLOB_OUTPUT; APEX_JSON.FREE_OUTPUT; . . . … but consider leveraging APEX_JSON to create, submit, receive, and interpret large volume batch requests instead … . . . APEX_WEB_SERVICE.G_REQUEST_HEADERS.DELETE(); APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).name := 'Content-Type'; APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).value := 'application/json'; recv_clob := APEX_WEB_SERVICE.MAKE_REST_REQUEST( p_url => 'https://api.geocod.io/v1.6/geocode?api_key=ofe…^$#@%^&$#@...ee5' ,p_http_method => 'POST' ,p_body => sent_clob ); . . . … and calling WSMs with APEX_WEB_SERVICE when complex processing and formatting of JSON or XML is required
  • 20. (Campaign) Signs and (Electoral) Portents • Visualizing Machine Learning Algorithms • APEX Google Map Plug-Ins
  • 21. Application Express (APEX) and ML / Analytics: A Most Excellent Pairing! 22 •Accesses same schema objects that Oracle Machine Learning (OML) and Oracle Analytic Cloud (OAC) already use •Powerful reporting and graphic toolsets •Seamless integration with Autonomous DB (ATP & ADW) APEX’s extensive and flexible application development capabilities pair nicely with ML algorithms and analytic reporting techniques
  • 22. Leveraging Google Map Plug-In Features Post-installation of Jeffery Kemp’s Google Maps API Plug-in 1 Build a query to add points on a Google Map 2 Controlling Google Map behavior and attributes 3
  • 23. Voila! Google Maps for Merchandise and Sign Distribution Get Jeffrey Kemp’s excellent Google Map Plug-ins: https://jeffkemponoracle.com/2016/02/google-map-apex- plugins/ This is an extremely simple example of the power behind this plug-in! Just about any feature of Google Maps can be exploited, including distancing, routing, and directions
  • 24. Useful Resources and Documentation • APEX_DATA_PARSER Implementation Examples: https://blogs.oracle.com/apex/super-easy-csv-xlsx-json-or-xml-parsing-about-the-apex_data_parser- package • APEX_JSON Examples: https://jsao.io/2015/07/relational-to-json-with-apex_json/ • Jeffrey Kemp’s Google Maps APEX Plug-ins: https://jeffkemponoracle.com/2016/02/google-map-apex-plugins/ https://jeffkemponoracle.com/tag/apex-plugins/ https://github.com/jeffreykemp/jk64-plugin-reportmap/wiki/SQL-Query-Examples • OML “Cheat Sheet”: https://www.oracle.com/a/tech/docs/oml4sql-algorithm-cheat-sheet-19c-v2.pdf

Editor's Notes

  • #15: Voter “flippability” Gerrymandered district stretches several dozen miles across five different counties and 56 municipalities Political landscape has changed dramatically in early months of 2020 Voter Outreach Record successful voter commitment to candidate Identify possible new volunteers and contributors Determine which messages resonate (retain!) … as well as which ones fall flat (discard!) Volunteer deployments Not everyone is not suited to canvassing! Mundane but crucial tasks cannot be ignored! Handling requests for yard signs from motivated voters Driving voter awareness through sign placement at high-traffic intersections
  • #23: APEX can access the same schema objects that Oracle Machine Learning (OML) and Oracle Analytic Cloud (OAC) already use Easy to combine ML algorithms simply into existing APEX applications No need to re-engineer or otherwise adapt existing code base Powerful reporting and graphic toolsets Interactive reporting capabilities offer excellent filtering and sorting abilities Extensive graphing formats comparable to OAC (radar, polar, funnel, etc.) Seamless integration with Autonomous DB APEX is already included in ADB layer No need for separate ORDS application server “Personalizable” URLs available for applications