1 / 77

E-Genting Programming Competition 2007

E-Genting Programming Competition 2007. Public Lecture by Jonathan Searcy 15 December 2007. Competition Questions. Air Pollution Monitor. Air Pollution Monitor. Dataflow Diagram. Generating an Image. Text File Format. Reading the Text File. Reading Lines of Input.

fathia
Download Presentation

E-Genting Programming Competition 2007

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. E-Genting Programming Competition 2007 Public Lecture by Jonathan Searcy 15 December 2007

  2. Competition Questions

  3. Air Pollution Monitor

  4. Air Pollution Monitor

  5. Dataflow Diagram

  6. Generating an Image

  7. Text File Format

  8. Reading the Text File

  9. Reading Lines of Input

  10. Converting Degrees, Minutes and Seconds into a Simple Scalar Quantity

  11. API Interpolation Formula

  12. API Interpolation Function

  13. Weighting Formula

  14. Weighting Curve

  15. Converting the Constant A

  16. Weighting Function

  17. Scaling the Image Required scale is 1:330,000. This means one inch on the map must correspond to 330,000 inches in the Klang Valley. Tookit.getScreenResolution gives us the screen resolution in pixels per inch, let us call it ‘R’. The inter-pixel distance on the map is 1/R. Therefore the inter-pixel distance in the Klang Valley is 330,000/R inches. The question paper tells us a minute of longitude at the equator is 72913 inches. Therefore the inter-pixel distance in tenths of seconds is (330,000*60*10)/(R*72913). If R is 96, the inter-pixel distance is approximately 28 tenths of a second.

  18. Calculating the Image Dimensions

  19. Filling In the Image

  20. API Status RGB Colour Components Red Green Blue 0-50 Good 0 204 255 51-100 Moderate 0 255 64 101-200 Unhealthy 255 255 0 201-300 Very unhealthy 255 153 0 301-500 Hazardous 255 0 0 Above 500 Emergency 255 255 255 Colour Table

  21. Converting the API into a Colour

  22. Passing the New Image to the Event Dispatch Thread

  23. Memory/Speed Trade Off

  24. Weighting Function Lookup Table

  25. Calculating the Range of the Weighting Function

  26. Creating the Weight Table

  27. Using the Weight Table

  28. Restricting the Scope of the Sum

  29. Creating the Quadrant Data Chains

  30. Determining the Quadrants to be Scanned

  31. Using the Quadrant Data Chains

  32. Summary • Using threads and concurrency to display one image while another is being generated. • Reading data from an HTTP server. • Reading fields from a text file. • Unit conversion. • Programming mathematical formulas. • Using the graphical functions of the language and operating system. • Using memory to obtain speed. • Using lookup tables to improve speed. • Using a grid to reduce the volume of data that needs to be processed.

  33. Merge and Sort

  34. Change Listing Format

  35. External Data Flows

  36. Record Structure

  37. Change Listing Syntax

  38. Reading an Input File

  39. Header Line Syntax

  40. Extracting the File Name

  41. Extracting the Release and Level

  42. Loading a Vector of Changes

  43. Specifying the Sorting Order

  44. Sorting the Vector

  45. Summary • How to get access to command line parameters from a program. • How to open and read characters from a text file. • How to read and interpret input sequences. • How to use the language or operating system sort functions. • How to emit text to the program’s standard output.

  46. Financial Statements

  47. Report Definition Tables

  48. Formula for Line Balance

  49. Calculating Line Balances

More Related