Author Topic: Intro and Lowest High question  (Read 4840 times)

vetenskapsman

  • Gentle Breeze
  • **
  • Posts: 10
    • KNMCORRA6
  • Station Details: Davis Vantage Pro2+, iMac (21.5-inch, Mid 2011), OS Sierra 10.12.1
Re: Intro and Lowest High question
« Reply #15 on: November 12, 2016, 05:43:56 PM »
I'm overly proud of myself but I did manage to coax applescript to spit out the values I'm looking for.  The last "programming" I did was for a beginning FORTRAN class using punchcards in 1978!  Let's just say my attempt is a bit a random walk.  Mostly I searched for snippets of code that I could copy and adapt and then I would spend and hour or two trying trying different things until the syntax was accepted.

Basically I feed the script the number of days in the past I want to search over.  Then I query WC data using the tag STAT$TEMPERATURE:MAX:DAYSAGO(x)$ to build a List with all the Maximum temperatures. (Thanks to Edourard who taught me you can query WC using applescript in the Applescript Editor).  Finally I call a subroutine? (not sure what they are called in applescript) that searches that List of daily maximum temps to find the *Lowest* one.

Finding the warmest night over a period I just have to alter the script to find the Maximum of a List of Minimum Daily Temps. 

So I can do this in the script editor but I kind of lost sight of my overall goal of updating a web page with that value. I'll have to think if there is a way to employ a version of this script in a synthetic channel somehow so I can then use a STAT$SYN1 type tag to easily push the value to a web page.

A better way as some of you have pointed out would be put the whole of the data into a database and then query that - but learning how to do all of that probably (likely.  It does.) exceed my motivation level to just report these values.  Just a few days ago it was a huge step for me just to use the atkins template  [biggrin].

I think I'll take a step back and play with kids my own age.  I should fool around with really simple html and focus on putting up basic web page.  After that I can perhaps consider taking on some of these more complicated tasks.

Thanks to all who have helped with ideas.  I've learned a ton in just a few days.  I'll probably let this specific challenge rattle around and see if a simple solution pops into existence that I can implement using my currently meager skills.

-carl

xairbusdriver

  • Storm
  • *****
  • Posts: 3130
Re: Intro and Lowest High question
« Reply #16 on: November 12, 2016, 06:10:43 PM »
Congratulations, Carl! I guarantee you've already done the hard part. Your solution may not be 'dynamic' (letting the viewer pick starting and ending dates, for example) but it should serve you well! [cheer]

You'll be happy to know that html is many times easier than AS! It is not even actually a "programming language". It's really only a 'mark-up' method describing now to display text and or graphics in a web browser. If you've ever used the 'full' post editor here (not the "Quick Reply" text box at the bottom of a page), you've actually been using a hybrid version of html! There are only a few dozen 'key words' you'll ever use and they always have the "<" and ">" characters surrounding them.

An html file is nothing more than plain text, so don't create it in a "word processor", doing that will add special codes that will only confuse a web browser. Unfortunately, adding html to most templates can be problematic. Most templates are collections of scripting 'codes' from PHP, javascript, etc. That can sometimes make it difficult to see what is actually html. Many template devs will probably offer some help, however.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6512
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Let here it for FORTRAN!! (Re: Intro and Lowest High question)
« Reply #17 on: November 12, 2016, 10:23:45 PM »
Dear Carl and WeatherCat "mature" coders, . . . .

I'm overly proud of myself but I did manage to coax applescript to spit out the values I'm looking for.  The last "programming" I did was for a beginning FORTRAN class using punchcards in 1978! 

Hey, you only beat me by 2 years!  I also started programming my second year at U.C. Berkeley in an introductory FORTRAN class using punched cards!  For better or worse I continued to dabble in programming although I've never really gotten very good at it.

So I can do this in the script editor but I kind of lost sight of my overall goal of updating a web page with that value. I'll have to think if there is a way to employ a version of this script in a synthetic channel somehow so I can then use a STAT$SYN1 type tag to easily push the value to a web page.

Speaking of never having gotten very good at programming, I can point you a way of converting AppleScript values into web page tags, but . . . . it is crude and complicated at best.  I wrote a batch of AppleScripts to support WeatherCat some years back and they still work if barely:

http://athena.trixology.com/index.php?topic=1039.0

You can certainly download them and see if that would be of any interest.  If you have succeeded this far, you might have a fighting chance to make the work.

Good luck!  Edouard

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1563
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: Let here it for FORTRAN!! (Re: Intro and Lowest High question)
« Reply #18 on: November 12, 2016, 10:52:42 PM »
Dear Carl and WeatherCat "mature" coders, . . . .

I'm overly proud of myself but I did manage to coax applescript to spit out the values I'm looking for.  The last "programming" I did was for a beginning FORTRAN class using punchcards in 1978! 

Hey, you only beat me by 2 years!  I also started programming my second year at U.C. Berkeley in an introductory FORTRAN class using punched cards!  For better or worse I continued to dabble in programming although I've never really gotten very good at it.

I never took programming classes in college. Those were only for CompSci majors. I did get to play "Moonlander" on the teletype deck at Bowling Green on a rented line to University of Toledo. :) That was in 1972. I didn't touch a computer for nearly ten years until I started doing BASIC programming on a Commodore VIC-20 in 1980. Man, what a wild ride it has been!
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

xairbusdriver

  • Storm
  • *****
  • Posts: 3130
Re: Intro and Lowest High question
« Reply #19 on: November 12, 2016, 11:05:25 PM »
The only "computers" we had in college were built from a couple of foot-long, plastic coated pieces of wood! One slid inside the other and the "cursor" slid along the wider one. But when I got to pilot training, we were given a round one made out of aluminum! It was much better aerodynamically, of course!
[removed link to the now castly photobucket.com site]
« Last Edit: December 30, 2017, 05:57:56 PM by xairbusdriver »
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

Felix

  • Gale
  • ****
  • Posts: 439
  • Station Details: Davis VP-2 Plus, FARS, WeatherLink IP. Sharx cams.
Re: Intro and Lowest High question
« Reply #20 on: November 12, 2016, 11:42:03 PM »
At the risk of dating myself, I started on an IBM 7094 in college. Undergrads ran their punch card decks from 2 a.m. - 6 a.m. I could never have imagined we'd have laptops running MATLAB in the future. Or, for that matter, that my slide rule would be replaced by a series of HP pocket calculators over the next so many years.