Page 27 of 55

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 16 Apr 2017 9:43 pm
by BCJKiwi
Hmm
Couldn't see any difference when I tested it.

What figures are different?
When this was discussed before, Ken True had a different suggestion for resolving this but don't recall what that was.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 18 Apr 2017 9:29 pm
by beteljuice
the beteljuice thinks he has made it php 5.x > php 7.0.x compatible.
... also an existing non-fatal missing declaration fixed.

Could someone using php5 AND someone using php7 please test this attachment against what they current have.

DON'T FORGET to back-up your existing betel_readDayfile.php and to change any options you may edited to your personal preferences.
betel_readDayfile.zip
Thank You

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 18 Apr 2017 10:36 pm
by jlmr731
Tested in php 5.6 seems good
In php 7.1 still get the same error in apache logs
PHP Warning: Illegal string offset 'short' in /var/www/html/test_readDayfile.php on line 1126, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780030 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP Stack trace:, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780038 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 1. {main}() /var/www/html/basic.php:0, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780043 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 2. include() /var/www/html/basic.php:11, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780047 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 3. drawCalendar() /var/www/html/test_readDayfile.php:1549, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780406 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP Warning: Illegal string offset 'short' in /var/www/html/test_readDayfile.php on line 1126, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780416 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP Stack trace:, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780420 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 1. {main}() /var/www/html/basic.php:0, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780423 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 2. include() /var/www/html/basic.php:11, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780426 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 3. drawCalendar() /var/www/html/test_readDayfile.php:1549, referer: http://youngstownweather.dynu.com/dailysummary.php
Hope that helps

Dont have a ton of data to go against maybe not being a full years worth cause this ? maybe?

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 18 Apr 2017 11:20 pm
by beteljuice
Urggh ....

Your average of averages (bottom line) is missing !

I am not happy :bash:
edit: ... and I haven't got a clue what isn't happening :cry:

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 19 Apr 2017 2:08 am
by jlmr731
beteljuice wrote:Urggh ....

Your average of averages (bottom line) is missing !

I am not happy :bash:
edit: ... and I haven't got a clue what isn't happening :cry:
Ugg yes I see that now, also tried with php 5.6 and looked that same :groan:

If there is anything that can be done like debugging let me know Ill try and help out

Even without average of averages I still love your work thanks so much !!!

Re: Yet Another Dayfile Reader (PHP)

Posted: Thu 20 Apr 2017 9:23 am
by mcrossley
Odd, I tried my variation of this script on PHP 7.0 yesterday and it ran without any errors. :?

I'm just plucking up the courage to switch the live server to PHP 7.0 from 5.6 - the rest of the site seems to be working OK on my dev server, it only required a small tweak to the MX Graphs.

Re: Yet Another Dayfile Reader (PHP)

Posted: Thu 01 Jun 2017 10:26 am
by Grimers
beteljuice, just wanted to bring to your attention that there are a lot of HTML validation errors in your code: https://validator.w3.org/nu/?doc=http%3 ... 2Fdata.php

Re: Yet Another Dayfile Reader (PHP)

Posted: Thu 01 Jun 2017 3:53 pm
by beteljuice
The check link responds ...
Document checking completed. No errors or warnings to show.

Used the HTML parser. Externally specified character encoding was UTF-8.

Total execution time 591 milliseconds.
False news grimers ?

Re: Yet Another Dayfile Reader (PHP)

Posted: Fri 02 Jun 2017 9:12 pm
by Grimers
Hehe, sorry I went and validated it and forgot to delete the post. LOL.

Just noticed that the rainfall total for Spring is wrong, it seems to be calculating it 1.0 mm above the actual value.

It shows 123.6 not 122.6.

Image

Thanks!

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 06 Jun 2017 7:54 am
by Grimers
beteljuice, have you got anywhere with this issue?

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 06 Jun 2017 2:07 pm
by Mapantz
The bug appears in the seasonal part if your dayfile has missing data from it. You have the 26th and 27th of April missing. So, you could fill in the blanks in the dayfile, if you know data for those days, or wait and be hopeful that the beteljuice returns.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 06 Jun 2017 3:17 pm
by mcrossley
Hmm, don't think I have any missing data and the current summer total is wrong on mine...
Capture.PNG
I'll take a look this evening...

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 06 Jun 2017 4:24 pm
by PaulMy
Mine http://www.komokaweather.com/weather/be ... maryCU.php also shows an extra 1 mm rainfall in Seasonal Summer 2017 (10.6 vs 9.6 actual). The sum for all past seasons' months seems correct.

Paul

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 06 Jun 2017 4:32 pm
by sfws
Everyone mentions about this year's rainfall, but that extra one is added to count for heating day, cooling day, wind run, evapotrans, and sunshine -i.e. any accumulating observation - in any season where there is an incomplete (yet non-zero) seasonal sum. Look at Mark's evapotrans for Spring 2013 as another example (80.1 becomes 81.1) or heating days winter 2010 (674 becomes 675). I will leave Mark to spot the ok zero ones!

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 06 Jun 2017 5:30 pm
by mcrossley
OK, I see why we get the 'extra' 1 on incomplete months - it is the month incomplete flag itself (which equals "true"), true gets equated to "1" when doing an array_sum(). Now to fix it!...

Edit: now fixed in my script, I'll leave it to beteljuice to correct the released script as mine has been modified quite a bit for the released code. beteljuice can view my code to see what I have done - but the gist is to remove the partial flag from the season array and put it in a separate array as is done for the monthly data.