Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
 
How healthy are the stars of stage and screen?

Very few of them, it would seem, are overweight and many are worryingly thin - rather a different situation you'll find in the UK / US population as a whole. Under a body - mass index (BMI) of around 18 to 20, people are considered to be underweight - and taking a data file of online data, I can calculate ...
14.87 Amber Valletta
14.94 Calista Flockhart
15.28 Carmen Kass
15.30 Shannon Elizabeth
15.37 Taylor Swift

Over 25 (or over 30 for bodybuilders and people of similar stature) and you're considered overweight. Let's see some of the chunkier stars:
26.29 Ben Stiller
27.06 Brad Pitt
27.89 Bruce Willis
29.30 Vin Diesel
31.00 Sylvester Stallone
35.96 Hulk Hogan

Body Mass Index (the slightly out of date way) is calculated as weight (in Kgs) upon the height (in metres) squared - and it's a regular exercise on our courses to have people write programs to work this out. In the case of the Java course I ran last week, I had my delegates reading this data from a file and the create Person objects from which the BMI could be extracted. That was - for future use - the algorithm's hidden with in ("encapsulated") in the class, and the future user only needs to know what to pass in and what's returned, and not how the work's actually done.

The example also illustrates:
• the use of the Compatable Interface (implememts Comparable) for sorting
• the use of a Vector to allow the program to dynamically allocate memory to suite the input file size
• the use of a factory design pattern to convert a text record into an object
• cacheing of calculation results to avoid repeated re-application of algorithms in an object
• for training purposes, a usage counter to see how many times a method was called
• trapping of erroneous data lines and flagging the errors to an error channel (System.err)
Source code [here]. Raw data [here].

(written 2015-02-09, updated 2015-02-12)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
J714 - Java - Fundamental classes
  [4431] A Java servlet that is also a stand alone program. And a server that is also a web client. - (2015-02-19)
  [4396] Java Utility class - flexible replacement for array. Also cacheing in objects and multiple catch clauses example. - (2015-01-16)
  [4330] Java - factory method, encapsulation, hashmap example - (2014-11-27)
  [3048] String handling - from first steps to practical examples - (2010-11-13)
  [2920] Sorting - naturally, or into a different order - (2010-08-14)
  [2734] for and foreach in Java - (2010-04-22)
  [2649] Length, size or capacity in Java? - (2010-02-24)
  [2421] Sorting Collections of Objects in Java - (2009-09-25)
  [2418] Viv.java uses unchecked or unsafe operations - explanation and cure - (2009-09-24)
  [2323] Java Collection Objects in the java.util package - (2009-08-05)
  [1910] Java - Generics - (2008-11-27)
  [1502] Java, sorting, ArrayList example, generics - (2008-01-11)
  [1062] Java sorting - comparable v comparator - (2007-02-02)
  [42] Do languages change? - (2004-09-08)

Q908 - Object Orientation and General technical topics - Object Orientation: Design Patterns
  [4673] Separating detailed data code from the main application - Ruby example - (2016-05-16)
  [4663] Easy data to object mapping (csv and Python) - (2016-03-24)
  [4626] Singleton design pattern - examples and uses - (2016-01-20)
  [4581] Thin application, thick objects - keep you main code simple. Example in Ruby - (2015-11-21)
  [4377] Designing a base class and subclasses, and their extension, in C++ - (2015-01-01)
  [4359] How to avoid too many recalculations within an object - (2014-12-21)
  [4356] Object factories in C++, Python, PHP and Perl - (2014-12-19)
  [4325] Learning to program - what are algorithms and design patterns? - (2014-11-22)
  [4098] Using object orientation for non-physical objects - (2013-05-22)
  [4096] Perl design patterns example - (2013-05-20)
  [4021] Spike solution, refactored and reusable, Python - Example - (2013-02-28)
  [3843] Caching Design Patterns - (2012-08-20)
  [3810] Reading files, and using factories to create vectors of objects from the data in C++ - (2012-07-21)
  [3716] Learning C++ - a design pattern for your first class - (2012-05-02)
  [3608] Design Patterns - what are they? Why use them? - (2012-02-12)
  [2977] What is a factory method and why use one? - Example in Ruby - (2010-09-30)
  [2741] What is a factory? - (2010-04-26)
  [2322] Looking for a practical standards course - (2009-08-05)
  [1224] Object Relation Mapping (ORM) - (2007-06-09)
  [485] North, Norther and Northest - PHP 5 Objects - (2005-11-04)


Back to
Flexibility in input - read from file, web resource or keyboard
Previous and next
or
Horse's mouth home
Forward to
Objects - from physical to virtual or abstract - Java
Some other Articles
A Welsh valley - what the transport looks like in 2015
Looking Forward - TransWilts Community Rail Partnership and TransWilts CIC
Campus - about the logos / way marks you have been choosing from
Objects - from physical to virtual or abstract - Java
How healthy are the stars of stage and screen?
Flexibility in input - read from file, web resource or keyboard
Java Inheritance example - group of classes - step by step
Melksham Community Campus - which of these potential signs do you like?
Crisp morning, fast run
Challenging the IT course business model
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2019: 404 The Spa • Melksham, Wiltshire • United Kingdom • SN12 6QL
PH: 01225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/4421_How ... reen-.html • PAGE BUILT: Sat May 27 16:49:10 2017 • BUILD SYSTEM: WomanWithCat