Trixology

WeatherCat => WeatherCat Web Templates => Topic started by: xairbusdriver on December 15, 2015, 11:57:17 PM

Title: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 15, 2015, 11:57:17 PM
Some templates give you a choice of NWS/NOAA icons for graphic display of forecast weather. I like the "KDE" versions since they are round with transparent corners. They are larger files being .png rather than .gif, but that also gives them a much larger range of colors.

The intermittent problem I'm seeing is that there seem to be some icons missing from the set I have. It appears to be an icon for windy conditions. The result is not terrible, there is simply an empty area where the icon belongs. There is not even the 'missing graphic' question mark. [cheer] Still, I'd like to find the latest and greatest icon set which hopefully has the required icon. My set has their Creation date of 18 Jun 2013. Are there newer versions? Haven't been able to find any on the interweb. [banghead]

Thanks!
Title: Re: Anyone have a location for "KDE icons"?
Post by: Bull Winkus on December 16, 2015, 10:47:09 PM
What does KDE mean?

I searched and got this. (https://www.google.com/search?q=kde+icons&newwindow=1&safe=off&biw=2560&bih=1356&source=lnms&tbm=isch&sa=X&sqi=2&ved=0ahUKEwjhpoStuuHJAhVW_mMKHXPpDSsQ_AUIBigB)

 [lol2]
Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 17, 2015, 03:26:05 AM
Yes, it is a widely used label. There are some operating systems that use the same letters <linkText (https://en.wikipedia.org/wiki/KDE)>. OTOH, it may refer to the Kentucky Department of Education...  [lol]

The specific mention of these icons is in some of the  stand alone templates from Mr. van dear Kuil's noaafct files. I believe the icons were designed specifically for use as replacements for the .gif and .jpg images provided by NOAA. I can not find any mention of them in a rather lengthy inter web search, either. I have other problems, right now with SWMBO's MBP back up drives that requires my complete attention!!! :-|

I need to add some echo commands in the PHP file that will display the exact value that is added to the image link text. As the code is now, if the icon/text is not found, the link ends up with an image labeled "folder_containing_images/.png". Normally, there is a number between the "/" and the "."; the icon would be something like "241.png". The PHP looks at an array with certain words (found in the NOAA text) that are replaced with specific numbers used in the image names.

It is possible that NOAA has changed a word and the script can't find it in the array. It is also possible that there is a new word added and there is no matching number, yet. At any rate, it is intermittent, so it's difficult to find the missing/added word until that is used in a NOAA Warning forecast. [banghead]

I have another plan for comparing what NOAA provides and what are available in the KDE images. That simply must wait until after the current back drive crisis is resolved. [lol]
Title: Re: Anyone have a location for "KDE icons"?
Post by: Bull Winkus on December 19, 2015, 06:41:48 AM
Whoosh! … Right over my head.

 [lol2]
Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 19, 2015, 05:08:58 PM
It's not as complicated as I describe it. [blush] The php 'simply' looks at the text NOAA/NWS sends for some 'key words (http://www.weather.gov/forecast-icons)' ("breezy with rain", "fog", "partly cloudy", etc.) and then changes the icon name variable as needed and spits out the html. When I have the time, and I notice the missing icon, I can edit the php to spit out what it 'thinks' the new value of the variable should be. It should be possible to then force the php to use a "generic" icon (901.png) to indicate there is no known image to display.
(http://i1327.photobucket.com/albums/u666/xAirbusDriver/901_zps1qgsvzg4.png)

Apparently, there is an error in my copy of the php (most likely introduced by me!), since I haven't seen any reports of this from anyone else.
Title: Remember the programming maxim . . (Re: Anyone have a location for "KDE icons"?)
Post by: elagache on December 19, 2015, 10:19:59 PM
Dear X-Air and WeatherCat tinkerers with code . . . .

Apparently, there is an error in my copy of the php (most likely introduced by me!), since I haven't seen any reports of this from anyone else.

In the voice of Yosemite Sam: . . . . .

That'll 'lurn 'ya! (http://www.canebas.org/WeatherCat/Forum_support_documents/Custom_emoticons/computer_sock_it_to_me.gif)

Remember that wise maxim about software:

If debugging is the process by which bugs are removed from code, then programming is undeniably the way to insert bugs into code! . . . (http://www.canebas.org/WeatherCat/Forum_support_documents/Custom_emoticons/dancing-spider-smiley-emoticon.gif)

Cheers, Edouard  [cheers1]
Title: Re: Remember the programming maxim . . (Re: Anyone have a location for "KDE icons"?)
Post by: maxen on December 20, 2015, 07:39:03 AM
...
Remember that wise maxim about software:

If debugging is the process by which bugs are removed from code, then programming is undeniably the way to insert bugs into code! . . .
Hmm. Interesting.

As I used to work with so called embedded programming, I was taught that:

"A code always contains at least one bug and
a code can always be shortened by at least one row
Which leads to:
Any code can always be shortened down to only one row ... which is a bug." [computer]

(...
Sorry to become completely off-topic now, but in case you did not know:
"Computer bugs" is named after the problems when real bugs crawled into the very first supercomputers. Insects crawled in by the vacuum tubes (warm and nice), and caused short circuits. Hence "debugging" back then was to actually go picking the dead bugs out of the computer racks. Things were more obvious.
https://www.msu.edu/course/lbs/126/lectures/history.html )

Ok, back to the thread now. Sorry for the interruption.
Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 20, 2015, 02:08:56 PM
I have that 'bug' text as an email signature. [tup]

I've downloaded the files, again and will go through them, one at a time, using BBEdit's 'compare' function to see if I can find any changes I made that would cause this.

As a last resort, I can use the NOAA images. However, those use the same array for selecting the image name, as far as I can remember. So the same problem should be seen, just with the uglier images, square 99.9% of the time. [rolleyes2]
Title: Re: Remember the programming maxim . . (Re: Anyone have a location for "KDE icons"?)
Post by: wurzelmac on December 20, 2015, 04:53:34 PM
(...
Sorry to become completely off-topic now, but in case you did not know:
"Computer bugs" is named after the problems when real bugs crawled into the very first supercomputers. Insects crawled in by the vacuum tubes (warm and nice), and caused short circuits. Hence "debugging" back then was to actually go picking the dead bugs out of the computer racks. Things were more obvious.
https://www.msu.edu/course/lbs/126/lectures/history.html )

Very intersting history of our most liked playtool - thanks for posting!

Cheers,
Reinhard
Title: Wikipedia on Grace Hopper. . (Re: Anyone have a location for "KDE icons"?)
Post by: elagache on December 20, 2015, 10:18:36 PM
Dear Robert, X-Air, Reinhard, and WeatherCat "quickly distracted from the topic" forum users, . . .

Sorry to become completely off-topic now, but in case you did not know:
"Computer bugs" is named after the problems when real bugs crawled into the very first supercomputers. Insects crawled in by the vacuum tubes (warm and nice), and caused short circuits. Hence "debugging" back then was to actually go picking the dead bugs out of the computer racks.

Actually the person given credit for coiling the word bug is given to Rear Admiral Grace M. Hopper:

https://en.wikipedia.org/wiki/Grace_Hopper (https://en.wikipedia.org/wiki/Grace_Hopper)

She was quite an amazing woman who was repeatedly called out of retirement to - I believe - become the first woman to reach the rank of Rear Admiral in the United States Navy.  She was one of the people who pushed for what would ultimately become the ARPAnet that lead to the Internet.

She was interviewed on the CBS news show 60 minutes in March of 1983.  I remember seeing it and being very impressed with her.


Ok, back to the thread now. Sorry for the interruption.

Well, maybe! . . . .  [biggrin]

Cheers, Edouard  [cheers1]
Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 20, 2015, 11:57:30 PM
Quote
Ok, back to the thread now.
Not so fast! I started this thread! :o

I believe Grace Hopper, Rear Admiral, USN, Ret, Ret, Ret, also had a hand in developing COBOL.

"Ok, now back to the thread." [coffee]
Title: Re: Anyone have a location for "KDE icons"?
Post by: wvdkuil on December 22, 2015, 02:57:24 PM
Some templates give you a choice of NWS/NOAA icons for graphic display of forecast weather. I like the "KDE" versions since they are round with transparent corners. They are larger files being .png rather than .gif, but that also gives them a much larger range of colors.

The intermittent problem I'm seeing is that there seem to be some icons missing from the set I have. It appears to be an icon for windy conditions. The result is not terrible, there is simply an empty area where the icon belongs. There is not even the 'missing graphic' question mark. [cheer] Still, I'd like to find the latest and greatest icon set which hopefully has the required icon. My set has their Creation date of 18 Jun 2013. Are there newer versions? Haven't been able to find any on the interweb. [banghead]

Thanks!
@xairbusdriver
Back from vacation without decent internet, now it is time to answer your question.

http://kde-look.org/content/show.php?content=39988
This is were all KDE icon-sets com from, last update of May 29 2006. Used on multiple sites and also in the Leuven-Template.

As you can see  the original set of icons is smaller as I modified the icons to show more conditions.
This is the link to the OLD-old Icon compare pages at http://www.weerstation-leuven.be/weather2/index.php?p=94&lang=en
The default (KDE based)  icon-set used is at the "Default" tab. There is also no wind icon in the original set, so I added another icon for that.

NOAA changed a lot of icons a few months ago when they introduced the dual-icons when they start using two 6-hour weather-conditions in one 12-hour icon.

The current scripts display NOAA forecasts using KDE where the dual icon is replaced by the first condition
http://weather-template.nl/weather28/index.php?p=noaa_full_page&lang=en&wp=WS
or NOAA icons, where the links to the original icons is used:
http://weather-template.nl/weather28/index.php?p=noaa_full_page&lang=en&wp=VWS

There must be an error in your version and to help you find a solution, I need:
1. The URL-link to your forecast page
2. The location-folder of the scripts.

Wim

P.S. You could also use the Leuven-Template and display the forecast inside an iframe:
http://weather-template.nl/weather28/index.php?p=noaa_full_page&lang=en&wp=WS&ipad

There are other users doing that, here you can see a demo at: http://wiri.be/saratoga/wxleuven.php?lang=en
The last drop-down menu item displays some Leuven-Template pages inside the original Saratoga-Template.

You could even run the VP console script if you want to do that, the console script is also in the same menu item.
Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 22, 2015, 06:03:11 PM
My Forecast page using the KDE icons (including the small ones):Mid-South Weather Forecast (http://mid-southweather.com/forecast.html) Looks similar your first linked page. My images show a Creation date in 2013, so I assume they include your additions. I added this comment in the last files set I got from Wim: 'blizzard'=>'432', added in 10/8/15 download.

Quote
There is also no wind icon in the original set, so I added another icon for that.
I think the missing icon occurred when there were higher winds forecast. Perhaps that's the one I'm missing and there is actually a new set available. Since it is a rare occurrence, it's somewhat difficult to 'nail down'.

I do have a set of "wind" images that deal with the small 'directional arrows' that are used in the week-at-a-glance graphic above the more detailed listing. Those seem to work fine.

The location of the images is an "img" folder at the root of my site. The pertinent (I think) noaaSettings.php is as follows:
Code: [Select]
if (!isset ($wsmyfolder) ) {
$wsmyfolder = '../'; // originally './'
}
# icons
$myImgDir = $wsmyfolder.'img/';
$myIconsDir = $wsmyfolder.'img/';
#
$myDefaultIconsDir = $myIconsDir.'default_icons/';
$myDefaultIconsSml = $myIconsDir.'default_icons_small/';
$myDefaultIconsExt = 'png';
When the NOAA forecast file is parsed, and there is no matching icon, the src then contains an image label of '/.png' which would be a 'hidden' file/directory and it is not even recognized at an image. Fortunately, that prevents the annoying and mostly useless "?" (missing image) display. ;D

Lastly, this forecast page uses a 'stand-alone' set of scripts, not a full template. Not sure if that makes a difference. Perhaps the full site templates use iFrames, not sure why that is needed or even desired. [blush]

Thanks for you input.
Title: Re: Anyone have a location for "KDE icons"?
Post by: wvdkuil on December 22, 2015, 06:34:06 PM
What I need to check the scripts is the location of the scripts, such as startNoaaFull.php and noaaPlainGenerateHtml.php
They are not in the root http://mid-southweather.com/
In what folder are the scripts stored: http://mid-southweather.com/folder????/????

Wim
Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 22, 2015, 09:02:51 PM
Quote
What I need to check the scripts is the location of the scripts, such as startNoaaFull.php and noaaPlainGenerateHtml.php
Here are some of the files at the root level of the site, as far as the forecast scripts and files are concerned. Note that I do not have a "startNoaaFull.php" file, perhaps you are referring to the "printFull.php" which is used to created the "myforecast.php"? The "img", "noaa_forcast", and "forecast.html" directories/files are all at the same level:
Code: [Select]
img/
    default_icons/
    default_icons_small/
    NOAA_Icons/
    NOAA_Icons_small/
    wind_icons/
    wind_icons_small/
    sunrise.png
    sunset.png

noaa_forecast/
    cache/
    lang/
    myforecast.php
    noaa3.css
    noaaDigitalGenerateHtml.php
    noaaPlainGenerateHtml.php
    noaaSettings-original.php
    noaaSettings.php
    printIcons.php
    printPlain.php
    printSmall.php
    startLeuven.php
    wxStartNoaaFct.php

forecast.html
<body id="top">

<div id="content">
<div id="content_main">
<div class="header">
<h1>7-Day Forecast</h1>
<h4 class="warning_text" style="margin-top:0;">Never base important
                                        decisions on this or any weather information obtained from a non-
                                        NWS site!</h4>
<?php include './WX-date-time-String.php'; ?>
</div>
<div class="centered_menu bottom_pad">
<ul class="dropdown">
<li><a href="./index.html">Current Conditions</a></li>
<li><a href="./gauges.html">Current Gauges</a></li>
<li id="current_page">Forecast</a></li>
<li>…remaining menu items…</li>
</ul>
</div>
<p style="clear:both;line-height:0;margin-top:-1em;">&nbsp;</p>
<?php include './noaa-warn/noaaWarning-start.php'; ?>
<h3 class="center top_pad bottom_pad">A Detailed Forecast</h3>

<?php include './noaa_forecast/myforecast.php'; ?>

<p class="center top"><a class="normal rounded" href="#top">Top of page</a></p>
</div>
<?php include './WX-pageFooter.php'; ?>
</div>
</body>
Title: Re: Anyone have a location for "KDE icons"?
Post by: wvdkuil on December 23, 2015, 09:05:11 AM
I assembled a list of all old and new NOAA icon descriptions to change the icon translate array.

Backup/copy:
1. Make a backup/copy of the noaaSettings.php script first
2. Make a backup/copy of the two folders:  img/default_icons/ and img/default_icons_small/

3. Use download link and unzip

4.1  You find a readme for the changes to the noaa_forecast/noaaSettings.php script
* 1 PHP statement should be changed
* The translate array should be replaced with the larger new one

5. In the zip there is the largest possible set of KDE based icons to replace the current ones in the img/default_icons/ and default_icons_small/ folder.

Please be aware that after doing this, you have to remove the current NOAA forecast from your cache/ folder

Wim

Attachment is to large to add to the message,  link to download http://weather-template.nl/extra_noaa.zip
Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 23, 2015, 04:04:29 PM
WOW! I'll download this in a minute! And thanks for your work on the old set of icons, also! I didn't know you had edited/added to the KDE set. Your graphics work is as professional as your programming! [tup]

I may wait until the weekend to do the editing and installation. We'll be pretty busy, anyway. We have a Severe WX warning out right now. Summer seems to be refusing to leave. High today is forecast to be 74°F! Very warm for two days before Christmas! We have a Forsythia bush that is starting to bloom! [banghead]

I just read the ReadMe.txt and see you found a mayjer erer in my editing:"Change... // added in 10/8/15 download" to "// changed 2015-12-23" Those European dates confuse me every time! ;D

Seriously, looks like some major additions to the array! That "warning.png" could come in handy in other areas of the site! Thanks, again!
Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 27, 2015, 11:46:22 PM
Mission complete! Also, fortunately, there was a missing icon because of a fairly gusty forecast this week. Sure enough, that's the kind of icon I needed several weeks ago.

Wim, your instructions were simple enough, even for me. But even after deleting the NOAA forecast text file and (supposedly) emptying the (two different) browser's cache, I was still getting the "?" indication. I think it was simply that your scripts don't check/read the NOAA text file if the 'time delay' ($cacheTime) has not run out. In any case, ~300 seconds after uploading the edited Warning.php file, up came the 'wind sock' icon! [cheer]

Now I'm going to RE-download the stand alone Forecast and Warning templates to see what values you had suggested. I have three different times; noaaPlainGenerateHtml.php: 3600 seconds (1 hour), noaaDigitalGenerateHtml.php: 7200 seconds, noaaWarning.php: 300 seconds comment="advised by noaa nws.eu"

I can understand that Warnings can change quite quickly and 5 minutes should help prevent everyone contacting NOAA too often.

Not sure why the Forecasts (Plain & Digital) use two different times. ??? Seems like 1 hour should be suitable. BTW, I'm assuming that these times are started based on the first time the script ever runs. Then ever 1 or 2 hours after that. :)
Title: Re: Anyone have a location for "KDE icons"?
Post by: wvdkuil on December 28, 2015, 09:51:06 AM
Mission complete! Also, fortunately, there was a missing icon because of a fairly gusty forecast this week. Sure enough, that's the kind of icon I needed several weeks ago.

Wim, your instructions were simple enough, even for me. But even after deleting the NOAA forecast text file and (supposedly) emptying the (two different) browser's cache, I was still getting the "?" indication. I think it was simply that your scripts don't check/read the NOAA text file if the 'time delay' ($cacheTime) has not run out. In any case, ~300 seconds after uploading the edited Warning.php file, up came the 'wind sock' icon! [cheer]

Now I'm going to RE-download the stand alone Forecast and Warning templates to see what values you had suggested. I have three different times; noaaPlainGenerateHtml.php: 3600 seconds (1 hour), noaaDigitalGenerateHtml.php: 7200 seconds, noaaWarning.php: 300 seconds comment="advised by noaa nws.eu"

I can understand that Warnings can change quite quickly and 5 minutes should help prevent everyone contacting NOAA too often.

Not sure why the Forecasts (Plain & Digital) use two different times. ??? Seems like 1 hour should be suitable. BTW, I'm assuming that these times are started based on the first time the script ever runs. Then ever 1 or 2 hours after that. :)

The cache time starts when a file is read from NOAA and the copy in the cache is to old.
So when there was no visitor in lets say 24 hours, the 3 files are read / processed and intermediate results are stored in the cache.

01:00 am: Last visit  and all files in the cache are valid when page is in the browser
10:00 am: Second visitor arrives and  all three files are read again  because 9 hours is longer then allowed cached time, all three files are stored in the cache with timestamp 10:00:??
10:01 am: Visitor request a fresh page, all data comes from cache as all files are just 1 minute old
10:06 am: Visitor request a fresh page, warnings are read from NOAA as they are older then allowed cache time of 5 minutes
11:10 am: Visitor request a fresh page, warnings (more then 5 minutes old) and plain forecast (> 1 hour) are read from NOAA.

Last question:  Why plain forecast 1 hour and Digital forecast 2 hours?

Plain forecast is a "nearly html.page " type request such as "give me the forecast for New-york". All people asking this forecast will get the exact same file returned

Digitial forecast is a very heavy request involving 100's maybe 1000's access by NOAA to gather the information.  It is tailored to your wishes.
This is the request screen: http://graphical.weather.gov/xml/SOAP_server/ndfdXML.htm
No two persons will request the same information, no caching possible at the NOAA site then. 
The returned file is  LARGE and complex with different (1 hour and 3 hour and other)  time-periods for different weather items. All data must be converted to a standard time period.

To lower the load on NOAA and on your webserver the cache time is set higher.

Also the cache times are not set exactly the same to spread the load during the day.
There is no data loaded from NOAA when there is no visitor at your site.  That is why the first visitors ( as all files are to old) response time in the morning is longer then subsequent visits.

Wim

Title: Re: Anyone have a location for "KDE icons"?
Post by: xairbusdriver on December 28, 2015, 05:20:12 PM
Thanks for the details! My need to know comes from years of a career in which minutia were important; the smallest details could kill you, if you allowed too many to accumulate! ;)

I may have seen the consequences of these large files not being downloaded completely. About 15 minutes after the final edits were made, I started seeing PHP error reports about incomplete data in one of those text files. I waited ~30 minutes and they went away. I think one of the NOAA reports was badly formatted or got corrupted in transmission. It could have been a heavy load on their servers, also; there has been a lot of severe weather in the US for the last few days. Not unlike what's happening in England/Scotland. Hope the storms die down before moving eastward.

Quote
That is why the first visitors ( as all files are to old) response time in the morning is longer then subsequent visits.
Good to know! I thought it was just my computer being slow to 'wake up'! [lol]

I should probably turn PHP error reporting off (or to different) settings, at least while things seem to be working so well. A topic for further study: PHP error reporting. I may try to find a way to convert those to get dumped to an email or handled more like a html 404 error, but errors that cause processing to stop would probably result simply in incomplete page displays...  [computer] :-[