more possible quirs in internet_weather.pl and weather_monitor.pl?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

more possible quirs in internet_weather.pl and weather_monitor.pl?

ricks03
mh 2.100

In internet_weather.pl:

if (said $v_get_internet_weather_data) {
     if (&net_connect_check) {
         my $city = $config_parms{city};
         $city = $config_parms{nws_city} if defined $config_parms{nws_city};
         set $p_weather_forecast qq|get_weather -state
$config_parms{state} -city "$config_parms{city}" -zone "$config_parms{zone}"|;

Given that this code attempts to insert the nws_city into $city if
its defined, the set command should use the value of $city, not the value of
$config_parms{city}, right?

and in weather_monitor.pl:
     if ($Weather{WindGustSpeed} == 0  and $Weather{WindGustSpeed} == 0) {
         $temp .= "There is currently no wind.";
     }
     else {
         $temp  .= "The wind is gusting at " .
             round($Weather{WindGustSpeed}) . " MPH from the " .
convert_direction($Weather{WindGustDir});
         $temp .= ".  Average speed is " .
             round($Weather{WindAvgSpeed}) . " from the " .
convert_direction($Weather{WindAvgDir});
     }

why does the starting "if" statement check WindGustSpeed == 0 twice?
Shouldn't it be

     if ($Weather{WindGustSpeed} == 0  and $Weather{WindAvgSpeed} == 0) {

?
Rick



Rick Steeves
[hidden email]                               http://www.sinister.net



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: more possible quirs in internet_weather.pl and weather_monitor.pl?

Bruce Winter
[hidden email] wrote:
> mh 2.100
>
> In internet_weather.pl:
...
> Given that this code attempts to insert the nws_city into $city if its
> defined, the set command should use the value of $city, not the value of
> $config_parms{city}, right?


Yep, John Wohlers sent that fix to me a month or 2 ago.


> and in weather_monitor.pl:
..
> why does the starting "if" statement check WindGustSpeed == 0 twice?
> Shouldn't it be
>
>     if ($Weather{WindGustSpeed} == 0  and $Weather{WindAvgSpeed} == 0) {

Yeps, seems right.  Thanks.

Bruce


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Loading...