SlideShare a Scribd company logo
1 of 49
Download to read offline
How JSR-385 could have
Saved the Mars Climate
Orbiter
Werner Keil & Thodoris Bais
#jfall19
@thodorisbais@wernerkeil
Mars Climate
Orbiter
ā€¢ Launched on 11
December 1998ā€Ø
ā€¢ 338 kilogramsā€Ø
ā€¢ $125 millionsā€Ø
ā€¢ To study Martian
climate, atmosphere
and surface changes
@thodorisbais@wernerkeil
Result of the Mission
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
What went wrong
@thodorisbais@wernerkeil
Mars Climate Orbiter
ā€œThe problem here was not the error; it was the
failure of NASAā€™s systems engineering, and the
checks and balances in our process, to detect the
error. Thatā€™s why we lost the spacecraft.ā€
Edward Weilerā€Ø
NASA associate administrator of space science,ā€Ø
IEEE Spectrum: Why the Mars Probe went oļ¬€ course
@thodorisbais@wernerkeil
Lessons Learned
@thodorisbais@wernerkeil
ā€¢Read the software speciļ¬cations
ā€¢Use JSR-385 instead of primitives
ā€¢Fail-fast
More unit mishaps
@thodorisbais@wernerkeil
Problem Statement
@thodorisbais@wernerkeil
What is the Fundamental
Problem?
Primitive (Java) types are primitive types
@thodorisbais@wernerkeil
What is the Fundamental Problem?
Primitive (Java) types are primitive types
ā€¢ static final double C = 1079252849;ā€Ø
ā€¢ static final double SPEED_OF_LIGHT = 1079252849;ā€Ø
ā€¢ static final double SPEED_OF_LIGHT_IN_KM_PER_H = 1079252849;
static final Quantity<SPEED> SPEED_OF_LIGHT =
Quantities.getQuantity(1079252849, Units.KILOMETRE_PER_HOUR);
@thodorisbais@wernerkeil
Rolling your Own Library
ā€¢ Development
ā€¢ Maintenance
ā€¢ Upgrades & extensions
@thodorisbais@wernerkeil
Werner Keil Thodoris Bais
Spec Lead JSR-385 Expert Group Member JSR-385
Letā€™s meet
@thodorisbais@wernerkeil
What is JSR-385?
@thodorisbais@wernerkeil
JSR-385: Units of Measurement API 2.0
Description

This JSR is a major evolution of the Unit API 1.0 (JSR 363) speciļ¬cation. Focussed
on the SI System redeļ¬nition, modularity and support for Java SE 8/9 and above.
JSR 363

This JSR speciļ¬es Java packages for modelling and working with measurement
values, quantities and their corresponding units.
@thodorisbais@wernerkeil
JSR-385 Basic Concepts
ā€¢ Dimensions

ā€¢ Units

ā€¢ Quantities

ā€¢ Preļ¬xes

ā€¢ Converters

ā€¢ Formats

ā€¢ Systems of units
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
Quantities
ā€“Wikipedia
ā€œA physical quantity is a physical property of a phenomenon, body,
or substance, that can be quantiļ¬ed by measurement.ā€
ā€“Ibidem
ā€œA physical quantity can be expressed as the combination of a
magnitude expressed by a number - usually a real umber - and a
unit.ā€
Deļ¬nition of a Physical Quantity
@thodorisbais@wernerkeil
Speed of Light
c = 299,792,458 m/s
Value Unit
@thodorisbais@wernerkeil
ā€“Wikipedia
ā€œA physical quantity is a physical property of a phenomenon, body, or substance,
that can be quantiļ¬ed by measurement.ā€
ā€œA physical quantity can be expressed as the combination of a magnitude
expressed by a number - usually a real umber - and a unit.ā€
Deļ¬nition of a Physical Quantity
ā€“Ibidem
ā€œThe same physical quantity can be represented equivalently in many unit
systems.ā€
@thodorisbais@wernerkeil
Speed of Light
c = 299,792,458 m/s
= 1,079,252,849 km/h
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
Units
Base Units
@thodorisbais@wernerkeil
Derived Units
@thodorisbais@wernerkeil
Multiples
ā€¢ km

ā€¢ ms

ā€¢ Mm?

ā€¢ ks?
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
Dimensions
Dimensions
ā€¢ L: length

ā€¢ T: time

ā€¢ M: mass

ā€¢ I: electric current

ā€¢ Ī˜: thermodynamic temperature

ā€¢ N: amount of substance

ā€¢ J: luminous intensity

ā€¢ (1)
Force: L Ā· M Ā· T-2
@thodorisbais@wernerkeil
Summary Table
@thodorisbais@wernerkeil
Doing the Maths
@thodorisbais@wernerkeil
Equality and Equivalence
ā€¢ kĪ© ā‰  mHz

ā€¢ kĪ© ā‰  mĪ©

ā€¢ kĪ© ā‰” kĪ©

ā€¢ N ā‰… kgĀ·mĀ·s-2

ā€¢ kgĀ·m-2 ā‰… mgĀ·mm-2
ā€¢ 1 kĪ© ā‰  1 mHz

ā€¢ 1 kĪ© ā‰  1 mĪ©

ā€¢ 1 kĪ© ā‰” 1 kĪ©

ā€¢ 1 N ā‰… 1 kgĀ·mĀ·s-2

ā€¢ 1 kgĀ·m-2 ā‰… 1 mgĀ·mm-2

ā€¢ 1 kĪ© ā‰… 1,000 Ī©
Units Quantities
@thodorisbais@wernerkeil
Quantity Addition
ā€¢ 1 Ī© + 1 Ī© = 2 Ī©

ā€¢ 1 Ī© + 1 mĪ© = 1.001 Ī©

ā€¢ 1 mĪ© + 1 Ī© = 1,001 mĪ©

ā€¢ 1 Ī© + 1 m ā€œdoes not computeā€
@thodorisbais@wernerkeil
JFall School 2019
October Exam on Maths
How much is 0 Ā°C + 0 Ā°C?
ā€¢ 0 Ā°C
ā€¢ 0 Ā°C
ā€¢ 273.15 Ā°C
Two absolute temperatures
0 Ā°C + 0 Ā°C = 273.15K + 273.15K
= 546.30K
= 273.15 Ā°C
@thodorisbais@wernerkeil
How much is 0 Ā°C + 0 Ā°C?
ā€¢ 0 Ā°C
ā€¢ 0 Ā°C
ā€¢ 273.15 Ā°C
An absolute temperature and a temperature change
0 Ā°C + 0 Ā°C = 273.15K + 0K
= 273.15K
= 0 Ā°C
@thodorisbais@wernerkeil
JFall School 2019
October Exam on Maths
How much is 0 Ā°C + 0 Ā°C?
ā€¢ 0 Ā°C
ā€¢ 0 Ā°C
ā€¢ 273.15 Ā°C
Two temperature changes
0 Ā°C + 0 Ā°C = 0K + 0K
= 0K
= 0 Ā°C
@thodorisbais@wernerkeil
JFall School 2019
October Exam on Maths
How much is 0 Ā°C + 0 Ā°C?
273.15 Ā°C (546.30 K)
0 Ā°C + 0 Ā°C = 0 Ā°C (273.15 K)
0 Ā°C (0 K)
Answer
@thodorisbais@wernerkeil
JFall School 2019
October Exam on Maths
Multiplication
Units
ā€¢kg Ɨ m = kgĀ·m
ā€¢kg Ɨ mm = kgĀ·mm
ā€¢g Ɨ km = gĀ·km ā‰Ÿ kgĀ·m
ā€¢m Ɨ m = m2
ā€¢km Ɨ km = km2
ā€¢mm Ɨ km = mmĀ·km ā‰Ÿ m2
ā€¢Āµm Ɨ m = ĀµmĀ·m ā‰Ÿ mm2
Quantities
ā€¢2 kg Ɨ 3 m = 6 kgĀ·m
@thodorisbais@wernerkeil
JFall School 2019
October Exam on Maths
Division
Units
ā€¢kg / m = kgĀ·m-1
ā€¢kg / mm = kgĀ·mm-1
ā€¢g / mm = gĀ·mm-1 ā‰Ÿ kgĀ·m-1
ā€¢m2 / m = m
ā€¢m / m = 1
ā€¢km / km = 1
ā€¢km / m = km/m ā‰Ÿ 1k
Quantities
ā€¢ 3 kg / 2 m = 1.5 kgĀ·m-1
@thodorisbais@wernerkeil
JFall School 2019
October Exam on Maths
Powers
Units
ā€¢(m)2 = m2ā€Ø
ā€¢(km)2 = km2
ā€¢(m2)2 = m4
Quantities
ā€¢ (3 m)2 = 9 m2
ā€¢
@thodorisbais@wernerkeil
JFall School 2019
October Exam on Maths
Celsius Revisited
Units
ā€¢(K)2 = K2ā€Ø
ā€¢(Ā°C)2 ā‰Ÿ (K - 273.15)2
ā€¢m Ɨ Ā°C ā‰Ÿ mĀ·(K - 273.15)
Quantities
ā€¢0 Ā°C2 ā‰Ÿ 74,610.9225 K2
ā€¢1 mĀ°C ā‰Ÿ 1 mK or 273.151K
@thodorisbais@wernerkeil
JFall School 2019
October Exam on Maths
Parsing Units & Quantities
ā€¢299,792,458 m/sā€Ø
ā€¢299792458 m/sā€Ø
ā€¢299792.458 km/sā€Ø
ā€¢299,792.458 km/sā€Ø
ā€¢299,792,458 km*s-1ā€Ø
ā€¢ 299,792.458 kmƗs-1
ā€¢299,792.458 kmĀ·s-1ā€Ø
ā€¢299,792.458 kmĀ·sā»Ā¹ā€Ø
ā€¢299,792.458 km*s^-1ā€Ø
ā€¢1,079,252,849 km/hā€Ø
ā€¢1,079,252,849 km/t
ā€¢ 670,616,629 mph
Speed of Light
@thodorisbais@wernerkeil
Systems of Unit
Systems of UnitSystems of Unit
ā€¢ Metric System
ā€¢ Imperial System
ā€¢ US customary units
ā€¢ Roman units of measurement
ā€¢Norwegian Units of Measurement
@thodorisbais@wernerkeil
Demo Time
@thodorisbais@wernerkeil
What Was the Fundamental
Problem Again?
Primitive (Java) types are primitive types
@thodorisbais@wernerkeil
Setting up a project
<dependencies>
<dependency>
<groupId>tech.units</groupId>
<artifactId>indriya</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
@thodorisbais@wernerkeil
JSR-385 Current Status
ā€¢ JCP page

ā€¢ https://jcp.org/en/jsr/detail?id=385

ā€¢ GitHub repositories

ā€¢ https://github.com/unitsofmeasurement

ā€¢ Current status

ā€¢ Final Release
@thodorisbais@wernerkeil
Java Community Process
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil
Weā€™re running for an Associate Seat!
Becoming a JCP Member
@thodorisbais@wernerkeil
@thodorisbais@wernerkeil

More Related Content

What's hot

Temperature
TemperatureTemperature
Temperature
MLFGarcia
Ā 
Motion SCIENCE
Motion SCIENCEMotion SCIENCE
Motion SCIENCE
Snju Lehri
Ā 
Lab 12 heat engines and 1st law
Lab 12 heat engines and 1st lawLab 12 heat engines and 1st law
Lab 12 heat engines and 1st law
MidoOoz
Ā 

What's hot (20)

L1 - Energy Systems and Thermofluids 2021-22
L1 - Energy Systems and Thermofluids 2021-22L1 - Energy Systems and Thermofluids 2021-22
L1 - Energy Systems and Thermofluids 2021-22
Ā 
Temperature
TemperatureTemperature
Temperature
Ā 
Heat Stress in Livestock and People
Heat Stress in Livestock and PeopleHeat Stress in Livestock and People
Heat Stress in Livestock and People
Ā 
Firemaps.net slideshare
Firemaps.net slideshareFiremaps.net slideshare
Firemaps.net slideshare
Ā 
Report data-logger full
Report data-logger fullReport data-logger full
Report data-logger full
Ā 
Motion SCIENCE
Motion SCIENCEMotion SCIENCE
Motion SCIENCE
Ā 
Chapter 14 heat and heat transfer methods
Chapter 14   heat and heat transfer methodsChapter 14   heat and heat transfer methods
Chapter 14 heat and heat transfer methods
Ā 
Fire tetrahedron
Fire tetrahedronFire tetrahedron
Fire tetrahedron
Ā 
Chapter 13 temperature kinetic theory and the gas laws
Chapter 13   temperature kinetic theory and the gas lawsChapter 13   temperature kinetic theory and the gas laws
Chapter 13 temperature kinetic theory and the gas laws
Ā 
Lab 12 heat engines and 1st law
Lab 12 heat engines and 1st lawLab 12 heat engines and 1st law
Lab 12 heat engines and 1st law
Ā 
Chapter 15 thermodynamics
Chapter 15   thermodynamicsChapter 15   thermodynamics
Chapter 15 thermodynamics
Ā 
Unit 14 Power Point
Unit 14 Power PointUnit 14 Power Point
Unit 14 Power Point
Ā 
Temperature MEASUREMENT
Temperature MEASUREMENTTemperature MEASUREMENT
Temperature MEASUREMENT
Ā 
Fire ppt
Fire pptFire ppt
Fire ppt
Ā 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Ā 
Thermodynamics
ThermodynamicsThermodynamics
Thermodynamics
Ā 
#20 Key
#20 Key#20 Key
#20 Key
Ā 
Measuring mass
Measuring massMeasuring mass
Measuring mass
Ā 
Thermal Energy PPT
Thermal Energy PPTThermal Energy PPT
Thermal Energy PPT
Ā 
OLM Science6_9
OLM Science6_9OLM Science6_9
OLM Science6_9
Ā 

Similar to How JSR 385 could have Saved the Mars Climate Orbiter JFall 2019

New chm 151 unit 1 powerpoints sp13 s
New chm 151 unit 1 powerpoints sp13 sNew chm 151 unit 1 powerpoints sp13 s
New chm 151 unit 1 powerpoints sp13 s
caneman1
Ā 
New chm-151-unit-1-20powerpoints-20sp13s-140227172225-phpapp01
New chm-151-unit-1-20powerpoints-20sp13s-140227172225-phpapp01New chm-151-unit-1-20powerpoints-20sp13s-140227172225-phpapp01
New chm-151-unit-1-20powerpoints-20sp13s-140227172225-phpapp01
Cleophas Rwemera
Ā 
Energy transfer and storage
Energy transfer and storageEnergy transfer and storage
Energy transfer and storage
mithilan
Ā 
Measurement and matter
Measurement and matterMeasurement and matter
Measurement and matter
MrCram
Ā 
Measurements &amp; units
Measurements &amp; unitsMeasurements &amp; units
Measurements &amp; units
ameermudasar
Ā 
01scientific measurement
01scientific measurement01scientific measurement
01scientific measurement
Dr Ahmad Fahmi
Ā 
0708 energy
0708 energy0708 energy
0708 energy
manman321
Ā 
0708 energy
0708 energy0708 energy
0708 energy
manman321
Ā 
2 matter and mesurement and elements of uncertatinty.ppt
2 matter and mesurement and elements of uncertatinty.ppt2 matter and mesurement and elements of uncertatinty.ppt
2 matter and mesurement and elements of uncertatinty.ppt
IrishPonce2
Ā 

Similar to How JSR 385 could have Saved the Mars Climate Orbiter JFall 2019 (20)

How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
Ā 
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
Ā 
New chm 151 unit 1 powerpoints sp13 s
New chm 151 unit 1 powerpoints sp13 sNew chm 151 unit 1 powerpoints sp13 s
New chm 151 unit 1 powerpoints sp13 s
Ā 
1-Physical-quantities-units.pdf
1-Physical-quantities-units.pdf1-Physical-quantities-units.pdf
1-Physical-quantities-units.pdf
Ā 
New chm-151-unit-1-20powerpoints-20sp13s-140227172225-phpapp01
New chm-151-unit-1-20powerpoints-20sp13s-140227172225-phpapp01New chm-151-unit-1-20powerpoints-20sp13s-140227172225-phpapp01
New chm-151-unit-1-20powerpoints-20sp13s-140227172225-phpapp01
Ā 
Chapter 12 ~ Work and Energy Transformation of energy ~ Nitin Agarwal
Chapter 12 ~ Work and Energy Transformation of energy ~ Nitin Agarwal Chapter 12 ~ Work and Energy Transformation of energy ~ Nitin Agarwal
Chapter 12 ~ Work and Energy Transformation of energy ~ Nitin Agarwal
Ā 
What is energy? Slide share
What is energy?  Slide shareWhat is energy?  Slide share
What is energy? Slide share
Ā 
Energy transfer and storage
Energy transfer and storageEnergy transfer and storage
Energy transfer and storage
Ā 
Unit 1 Presentation
Unit 1 PresentationUnit 1 Presentation
Unit 1 Presentation
Ā 
energy
energy energy
energy
Ā 
Lect1(unit).ppt
Lect1(unit).pptLect1(unit).ppt
Lect1(unit).ppt
Ā 
Measurement and matter
Measurement and matterMeasurement and matter
Measurement and matter
Ā 
Unit 1 Numbers
Unit 1 NumbersUnit 1 Numbers
Unit 1 Numbers
Ā 
Sec 4 Chapter 3
Sec 4 Chapter 3Sec 4 Chapter 3
Sec 4 Chapter 3
Ā 
Measurements &amp; units
Measurements &amp; unitsMeasurements &amp; units
Measurements &amp; units
Ā 
Ppt#1 chapters 0+1
Ppt#1 chapters 0+1Ppt#1 chapters 0+1
Ppt#1 chapters 0+1
Ā 
01scientific measurement
01scientific measurement01scientific measurement
01scientific measurement
Ā 
0708 energy
0708 energy0708 energy
0708 energy
Ā 
0708 energy
0708 energy0708 energy
0708 energy
Ā 
2 matter and mesurement and elements of uncertatinty.ppt
2 matter and mesurement and elements of uncertatinty.ppt2 matter and mesurement and elements of uncertatinty.ppt
2 matter and mesurement and elements of uncertatinty.ppt
Ā 

More from Thodoris Bais

More from Thodoris Bais (20)

EclipseCon 2021 NoSQL Endgame
EclipseCon 2021 NoSQL EndgameEclipseCon 2021 NoSQL Endgame
EclipseCon 2021 NoSQL Endgame
Ā 
You Graduated Now What ECE UoWM 2021
You Graduated Now What ECE UoWM 2021You Graduated Now What ECE UoWM 2021
You Graduated Now What ECE UoWM 2021
Ā 
NoSQL Endgame LWJUG 2021
NoSQL Endgame LWJUG 2021NoSQL Endgame LWJUG 2021
NoSQL Endgame LWJUG 2021
Ā 
Be the Leader of Your Own Career Global Summit for Java Devs 21
Be the Leader of Your Own Career Global Summit for Java Devs 21Be the Leader of Your Own Career Global Summit for Java Devs 21
Be the Leader of Your Own Career Global Summit for Java Devs 21
Ā 
How to grow an amazing community - JavaLand 2021
How to grow an amazing community - JavaLand 2021How to grow an amazing community - JavaLand 2021
How to grow an amazing community - JavaLand 2021
Ā 
Securing eHealth, eGovernment and eBanking with Java - IT-Tage 2020 Conference
Securing eHealth, eGovernment and eBanking with Java - IT-Tage 2020 ConferenceSecuring eHealth, eGovernment and eBanking with Java - IT-Tage 2020 Conference
Securing eHealth, eGovernment and eBanking with Java - IT-Tage 2020 Conference
Ā 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
Ā 
Securing eHealth, eGovernment and eBanking with Java - JCON Conference
 Securing eHealth, eGovernment and eBanking with Java - JCON Conference Securing eHealth, eGovernment and eBanking with Java - JCON Conference
Securing eHealth, eGovernment and eBanking with Java - JCON Conference
Ā 
Be the Leader of Your Own Career JCON Conference 2020
Be the Leader of Your Own Career JCON Conference 2020Be the Leader of Your Own Career JCON Conference 2020
Be the Leader of Your Own Career JCON Conference 2020
Ā 
NoSQL Endgame JCON Conference 2020
NoSQL Endgame JCON Conference 2020NoSQL Endgame JCON Conference 2020
NoSQL Endgame JCON Conference 2020
Ā 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
Ā 
Utrecht JUG meetup September 2020
Utrecht JUG meetup September 2020Utrecht JUG meetup September 2020
Utrecht JUG meetup September 2020
Ā 
Developer Career: Own it - SouJava April 2020
Developer Career: Own it - SouJava April 2020Developer Career: Own it - SouJava April 2020
Developer Career: Own it - SouJava April 2020
Ā 
Securing eHealth and eGovernment with Java - AllTheTalksOnline 2020
Securing eHealth and eGovernment with Java - AllTheTalksOnline 2020Securing eHealth and eGovernment with Java - AllTheTalksOnline 2020
Securing eHealth and eGovernment with Java - AllTheTalksOnline 2020
Ā 
How to pitch an innovative idea in a corporate environment
How to pitch an innovative idea in a corporate environmentHow to pitch an innovative idea in a corporate environment
How to pitch an innovative idea in a corporate environment
Ā 
Utrecht JUG meetup February 2020
Utrecht JUG meetup February 2020Utrecht JUG meetup February 2020
Utrecht JUG meetup February 2020
Ā 
Developer Career: Own it - Adorsys 2020
Developer Career: Own it - Adorsys 2020Developer Career: Own it - Adorsys 2020
Developer Career: Own it - Adorsys 2020
Ā 
Utrecht JUG Meetup January 2020
Utrecht JUG Meetup January 2020Utrecht JUG Meetup January 2020
Utrecht JUG Meetup January 2020
Ā 
Developer Career: Own it - Java2Days 2019
Developer Career: Own it - Java2Days 2019Developer Career: Own it - Java2Days 2019
Developer Career: Own it - Java2Days 2019
Ā 
Securing eHealth and eGovernment with Java - Java2Days 2019
Securing eHealth and eGovernment with Java - Java2Days 2019Securing eHealth and eGovernment with Java - Java2Days 2019
Securing eHealth and eGovernment with Java - Java2Days 2019
Ā 

Recently uploaded

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
Ā 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Andrea Goulet
Ā 

Recently uploaded (20)

Abortion Clinic In Pretoria ](+27832195400*)[ šŸ„ Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ šŸ„ Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ šŸ„ Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ šŸ„ Safe Abortion Pills in Pretor...
Ā 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Ā 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
Ā 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Ā 
Abortion Pill Prices Germiston ](+27832195400*)[ šŸ„ Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ šŸ„ Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ šŸ„ Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ šŸ„ Women's Abortion Clinic in...
Ā 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
Ā 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Ā 
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with GraphGraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
Ā 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
Ā 
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
Ā 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
Ā 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
Ā 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
Ā 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ā— Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ā— Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ā— Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ā— Abortion...
Ā 
Abortion Clinic In Johannesburg ](+27832195400*)[ šŸ„ Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ šŸ„ Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ šŸ„ Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ šŸ„ Safe Abortion Pills in Jo...
Ā 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
Ā 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
Ā 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Ā 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
Ā 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
Ā 

How JSR 385 could have Saved the Mars Climate Orbiter JFall 2019

  • 1. How JSR-385 could have Saved the Mars Climate Orbiter Werner Keil & Thodoris Bais #jfall19 @thodorisbais@wernerkeil
  • 2. Mars Climate Orbiter ā€¢ Launched on 11 December 1998ā€Ø ā€¢ 338 kilogramsā€Ø ā€¢ $125 millionsā€Ø ā€¢ To study Martian climate, atmosphere and surface changes @thodorisbais@wernerkeil
  • 3. Result of the Mission @thodorisbais@wernerkeil
  • 6. Mars Climate Orbiter ā€œThe problem here was not the error; it was the failure of NASAā€™s systems engineering, and the checks and balances in our process, to detect the error. Thatā€™s why we lost the spacecraft.ā€ Edward Weilerā€Ø NASA associate administrator of space science,ā€Ø IEEE Spectrum: Why the Mars Probe went oļ¬€ course @thodorisbais@wernerkeil
  • 7. Lessons Learned @thodorisbais@wernerkeil ā€¢Read the software speciļ¬cations ā€¢Use JSR-385 instead of primitives ā€¢Fail-fast
  • 10. What is the Fundamental Problem? Primitive (Java) types are primitive types @thodorisbais@wernerkeil
  • 11. What is the Fundamental Problem? Primitive (Java) types are primitive types ā€¢ static final double C = 1079252849;ā€Ø ā€¢ static final double SPEED_OF_LIGHT = 1079252849;ā€Ø ā€¢ static final double SPEED_OF_LIGHT_IN_KM_PER_H = 1079252849; static final Quantity<SPEED> SPEED_OF_LIGHT = Quantities.getQuantity(1079252849, Units.KILOMETRE_PER_HOUR); @thodorisbais@wernerkeil
  • 12. Rolling your Own Library ā€¢ Development ā€¢ Maintenance ā€¢ Upgrades & extensions @thodorisbais@wernerkeil
  • 13. Werner Keil Thodoris Bais Spec Lead JSR-385 Expert Group Member JSR-385 Letā€™s meet @thodorisbais@wernerkeil
  • 15. JSR-385: Units of Measurement API 2.0 Description This JSR is a major evolution of the Unit API 1.0 (JSR 363) speciļ¬cation. Focussed on the SI System redeļ¬nition, modularity and support for Java SE 8/9 and above. JSR 363 This JSR speciļ¬es Java packages for modelling and working with measurement values, quantities and their corresponding units. @thodorisbais@wernerkeil
  • 16. JSR-385 Basic Concepts ā€¢ Dimensions ā€¢ Units ā€¢ Quantities ā€¢ Preļ¬xes ā€¢ Converters ā€¢ Formats ā€¢ Systems of units @thodorisbais@wernerkeil
  • 18. ā€“Wikipedia ā€œA physical quantity is a physical property of a phenomenon, body, or substance, that can be quantiļ¬ed by measurement.ā€ ā€“Ibidem ā€œA physical quantity can be expressed as the combination of a magnitude expressed by a number - usually a real umber - and a unit.ā€ Deļ¬nition of a Physical Quantity @thodorisbais@wernerkeil
  • 19. Speed of Light c = 299,792,458 m/s Value Unit @thodorisbais@wernerkeil
  • 20. ā€“Wikipedia ā€œA physical quantity is a physical property of a phenomenon, body, or substance, that can be quantiļ¬ed by measurement.ā€ ā€œA physical quantity can be expressed as the combination of a magnitude expressed by a number - usually a real umber - and a unit.ā€ Deļ¬nition of a Physical Quantity ā€“Ibidem ā€œThe same physical quantity can be represented equivalently in many unit systems.ā€ @thodorisbais@wernerkeil
  • 21. Speed of Light c = 299,792,458 m/s = 1,079,252,849 km/h @thodorisbais@wernerkeil
  • 25. Multiples ā€¢ km ā€¢ ms ā€¢ Mm? ā€¢ ks? @thodorisbais@wernerkeil
  • 27. Dimensions ā€¢ L: length ā€¢ T: time ā€¢ M: mass ā€¢ I: electric current ā€¢ Ī˜: thermodynamic temperature ā€¢ N: amount of substance ā€¢ J: luminous intensity ā€¢ (1) Force: L Ā· M Ā· T-2 @thodorisbais@wernerkeil
  • 30. Equality and Equivalence ā€¢ kĪ© ā‰  mHz ā€¢ kĪ© ā‰  mĪ© ā€¢ kĪ© ā‰” kĪ© ā€¢ N ā‰… kgĀ·mĀ·s-2 ā€¢ kgĀ·m-2 ā‰… mgĀ·mm-2 ā€¢ 1 kĪ© ā‰  1 mHz ā€¢ 1 kĪ© ā‰  1 mĪ© ā€¢ 1 kĪ© ā‰” 1 kĪ© ā€¢ 1 N ā‰… 1 kgĀ·mĀ·s-2 ā€¢ 1 kgĀ·m-2 ā‰… 1 mgĀ·mm-2 ā€¢ 1 kĪ© ā‰… 1,000 Ī© Units Quantities @thodorisbais@wernerkeil
  • 31. Quantity Addition ā€¢ 1 Ī© + 1 Ī© = 2 Ī© ā€¢ 1 Ī© + 1 mĪ© = 1.001 Ī© ā€¢ 1 mĪ© + 1 Ī© = 1,001 mĪ© ā€¢ 1 Ī© + 1 m ā€œdoes not computeā€ @thodorisbais@wernerkeil
  • 32. JFall School 2019 October Exam on Maths How much is 0 Ā°C + 0 Ā°C? ā€¢ 0 Ā°C ā€¢ 0 Ā°C ā€¢ 273.15 Ā°C Two absolute temperatures 0 Ā°C + 0 Ā°C = 273.15K + 273.15K = 546.30K = 273.15 Ā°C @thodorisbais@wernerkeil
  • 33. How much is 0 Ā°C + 0 Ā°C? ā€¢ 0 Ā°C ā€¢ 0 Ā°C ā€¢ 273.15 Ā°C An absolute temperature and a temperature change 0 Ā°C + 0 Ā°C = 273.15K + 0K = 273.15K = 0 Ā°C @thodorisbais@wernerkeil JFall School 2019 October Exam on Maths
  • 34. How much is 0 Ā°C + 0 Ā°C? ā€¢ 0 Ā°C ā€¢ 0 Ā°C ā€¢ 273.15 Ā°C Two temperature changes 0 Ā°C + 0 Ā°C = 0K + 0K = 0K = 0 Ā°C @thodorisbais@wernerkeil JFall School 2019 October Exam on Maths
  • 35. How much is 0 Ā°C + 0 Ā°C? 273.15 Ā°C (546.30 K) 0 Ā°C + 0 Ā°C = 0 Ā°C (273.15 K) 0 Ā°C (0 K) Answer @thodorisbais@wernerkeil JFall School 2019 October Exam on Maths
  • 36. Multiplication Units ā€¢kg Ɨ m = kgĀ·m ā€¢kg Ɨ mm = kgĀ·mm ā€¢g Ɨ km = gĀ·km ā‰Ÿ kgĀ·m ā€¢m Ɨ m = m2 ā€¢km Ɨ km = km2 ā€¢mm Ɨ km = mmĀ·km ā‰Ÿ m2 ā€¢Āµm Ɨ m = ĀµmĀ·m ā‰Ÿ mm2 Quantities ā€¢2 kg Ɨ 3 m = 6 kgĀ·m @thodorisbais@wernerkeil JFall School 2019 October Exam on Maths
  • 37. Division Units ā€¢kg / m = kgĀ·m-1 ā€¢kg / mm = kgĀ·mm-1 ā€¢g / mm = gĀ·mm-1 ā‰Ÿ kgĀ·m-1 ā€¢m2 / m = m ā€¢m / m = 1 ā€¢km / km = 1 ā€¢km / m = km/m ā‰Ÿ 1k Quantities ā€¢ 3 kg / 2 m = 1.5 kgĀ·m-1 @thodorisbais@wernerkeil JFall School 2019 October Exam on Maths
  • 38. Powers Units ā€¢(m)2 = m2ā€Ø ā€¢(km)2 = km2 ā€¢(m2)2 = m4 Quantities ā€¢ (3 m)2 = 9 m2 ā€¢ @thodorisbais@wernerkeil JFall School 2019 October Exam on Maths
  • 39. Celsius Revisited Units ā€¢(K)2 = K2ā€Ø ā€¢(Ā°C)2 ā‰Ÿ (K - 273.15)2 ā€¢m Ɨ Ā°C ā‰Ÿ mĀ·(K - 273.15) Quantities ā€¢0 Ā°C2 ā‰Ÿ 74,610.9225 K2 ā€¢1 mĀ°C ā‰Ÿ 1 mK or 273.151K @thodorisbais@wernerkeil JFall School 2019 October Exam on Maths
  • 40. Parsing Units & Quantities ā€¢299,792,458 m/sā€Ø ā€¢299792458 m/sā€Ø ā€¢299792.458 km/sā€Ø ā€¢299,792.458 km/sā€Ø ā€¢299,792,458 km*s-1ā€Ø ā€¢ 299,792.458 kmƗs-1 ā€¢299,792.458 kmĀ·s-1ā€Ø ā€¢299,792.458 kmĀ·sā»Ā¹ā€Ø ā€¢299,792.458 km*s^-1ā€Ø ā€¢1,079,252,849 km/hā€Ø ā€¢1,079,252,849 km/t ā€¢ 670,616,629 mph Speed of Light @thodorisbais@wernerkeil
  • 41. Systems of Unit Systems of UnitSystems of Unit ā€¢ Metric System ā€¢ Imperial System ā€¢ US customary units ā€¢ Roman units of measurement ā€¢Norwegian Units of Measurement @thodorisbais@wernerkeil
  • 43. What Was the Fundamental Problem Again? Primitive (Java) types are primitive types @thodorisbais@wernerkeil
  • 44. Setting up a project <dependencies> <dependency> <groupId>tech.units</groupId> <artifactId>indriya</artifactId> <version>2.0</version> </dependency> </dependencies> @thodorisbais@wernerkeil
  • 45. JSR-385 Current Status ā€¢ JCP page ā€¢ https://jcp.org/en/jsr/detail?id=385 ā€¢ GitHub repositories ā€¢ https://github.com/unitsofmeasurement ā€¢ Current status ā€¢ Final Release @thodorisbais@wernerkeil
  • 48. Becoming a JCP Member @thodorisbais@wernerkeil