phpweather-devel Mailing List for PHP Weather (Page 23)
Brought to you by:
iridium
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(4) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
(52) |
Mar
(79) |
Apr
(9) |
May
(28) |
Jun
(17) |
Jul
(25) |
Aug
(48) |
Sep
(18) |
Oct
(6) |
Nov
|
Dec
(8) |
2003 |
Jan
(26) |
Feb
(10) |
Mar
(2) |
Apr
(21) |
May
(23) |
Jun
(15) |
Jul
(15) |
Aug
(8) |
Sep
(16) |
Oct
(3) |
Nov
(4) |
Dec
|
2004 |
Jan
(35) |
Feb
(35) |
Mar
(9) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(4) |
Feb
(6) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2006 |
Jan
|
Feb
(5) |
Mar
(7) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Martin G. <gim...@gi...> - 2002-02-03 16:02:16
|
"Ray van Beek" <r_v...@ho...> writes: (By the way: please subscribe to the list - postings from non-subscribed addresses are held for approval until I either approve them or rejects them.) > Martin, > > I tried your suggestions but can't get it to work. I suspect the > extract function > > function extract($array) { > > while (list($key, $val) = each($array)) { > $GLOBALS["\"". $key. "\""] = $val; > } >} Why have you wrapped $key in a pair of double quotes? > I tracked the data from the METAR string to the extract function. I > found that at a given iteration of the loop, the temp_c key is > coming by. Then at the end of the function, I checked for a variable > $temp_c but this results in nothing to be printed with: > > printf($temp_c); > > Is the $GLOBAL contruction > correct for php3.0.3? Well, I don't know? I was hoping that you could test that for me :-) Try making a simple file like this: function f($a) { $GLOBALS['foo'] = $a; } f('Hello'); echo $foo; That should print Hello, indicating that the function f is able to access the global variables through $GLOBALS. > By the way: I know that it would be best to ask the admin of the > host provider to upgrade, I found out that my account is stored on > some virtual server in a server farm. The company I obtained the > account from only rents a virtual server, so I don't think that this > company is able to upgrade php 3... unfortunately. But... it's really easy to install PHP4 - if they managed to install PHP3, then it shouldn't take them more that half an hour to install PHP4... but on the other hand: I would like to support all possible versions of PHP, so it's not all bad :-) -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |
From: Ray v. B. <r_v...@ho...> - 2002-02-03 15:33:43
|
Martin, I tried your suggestions but can't get it to work. I suspect the extract function function extract($array) { while (list($key, $val) = each($array)) { $GLOBALS["\"". $key. "\""] = $val; } } I tracked the data from the METAR string to the extract function. I found that at a given iteration of the loop, the temp_c key is coming by. Then at the end of the function, I checked for a variable $temp_c but this results in nothing to be printed with: printf($temp_c); Is the $GLOBAL contruction correct for php3.0.3? By the way: I know that it would be best to ask the admin of the host provider to upgrade, I found out that my account is stored on some virtual server in a server farm. The company I obtained the account from only rents a virtual server, so I don't think that this company is able to upgrade php 3... unfortunately. Greetz, Ray _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com |
From: Martin G. <gim...@gi...> - 2002-02-03 10:04:19
|
"Funder, Johnny OTP" <jh...@NA...> writes: > Hi, > > For your information, the official formular looks like this: > > 1779,75 (Td - Tt) > RH = ANTILOG ( -------------------------- + 2 ) > (237,3 + Td) ( 237.3 + Tt) > > where Tt = temperature and Td = dewpoint (of course) > > This is how my code looks like in Fortran 77 (for what it's worth) > > > TAELLER = (DEWPOINT-TEMPERATURE)*1779.75 > NAEVNER = (237.3+DEWPOINT)*(237.3+TEMPERATURE) > LOG10_VAL = ((TAELLER/NAEVNER)+2) > BASE = 10 > CONSTANT = LOG(BASE) > R_HUMIDITY = EXP(LOG10_VAL * CONSTANT) > > It should be very easy to convert that to php. Very nice - I'll update the tarballs accordingly, just as soon at I hear about my attempts at implementing extract and str_replace in PHP3-friendly code. By the way: I've been thinking about putting the old-but-working code into CVS at Sourceforge. It seams that people are using v 1.59 and are happy about it, so we should make it easy for ourselves to fix things in that source-tree as well. Is there anybody here who has experience with branches in CVS? I've only used CVS for PHP Weather, but I think that we should do a branch here, so that we could have the stable and unstable code in CVS at the same time. I know that we could also just make a directory called 'old' or something like that, but it doesn't sound like the correct way to do things with CVS. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |
From: Martin G. <gim...@gi...> - 2002-02-03 09:58:25
|
"Ray van Beek" <r_v...@ho...> writes: > Hi all! > > My hosting provider runs php 3.0.3 (I know, I know!). OK - but you have told them to upgrade, haven't you? > Phpweather 1.59 does not run on this php, it crashes to some > functions that are used (like extract and str_replace). I see - the manual explains that they were added in PHP version 3.0.7 and 3.0.6, respectively. > Was there some previous phpweather version that ran on php 3.0.3? Or > do I have to 'down-tune' the latest version to make it work? Instead of down-tuning, you could implement the two missing functions yourself: function extract($array) { while (list($key, $val) = each($array)) { $GLOBALS[$key] = $val; } } function str_replace($search, $replace, $subject) { $search_length = strlen($search); $replace_length = strlen($replace); $i = 0; while ($i < strlen($subject)) { if ($search == substr($subject, $i, $search_length)) { $subject = substr($subject, 0, $i) . $replace . substr($subject, $i+$search_length); $i += $replace_length; } else { $i += 1; } } return $subject; } I don't know if these functions work in PHP3, but I've tried to restrict myself to functions that existed in PHP3, according to the manual. If the work, then I'll put them into two files, extract.php and str_replace.php and include them in the tarball, so that people who lack them can include the files before including the other PHP Weather files. How does that idea sound? -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |
From: Funder, J. O. <jh...@NA...> - 2002-02-01 07:29:57
|
Hi, For your information, the official formular looks like this: 1779,75 (Td - Tt) RH = ANTILOG ( -------------------------- + 2 ) (237,3 + Td) ( 237.3 + Tt) where Tt = temperature and Td = dewpoint (of course) This is how my code looks like in Fortran 77 (for what it's worth) TAELLER = (DEWPOINT-TEMPERATURE)*1779.75 NAEVNER = (237.3+DEWPOINT)*(237.3+TEMPERATURE) LOG10_VAL = ((TAELLER/NAEVNER)+2) BASE = 10 CONSTANT = LOG(BASE) R_HUMIDITY = EXP(LOG10_VAL * CONSTANT) It should be very easy to convert that to php. best regards Johnny Funder Danish Civil Aviation Administration Software development division. -----Oprindelig meddelelse----- Fra: James and Jan Wiles [mailto:kk...@nc...] Sendt: 1. februar 2002 07:21 Til: php...@li... Emne: Humidity Calculation Error and Fix v 1.59 In using PHPWeather for an amateur-radio project I am working on, I came across a situation where the humidity was being incorrectly calculated. This afternoon, for the station PAPK (Anaktuvuk Pass, AK--I just picked it at random!), PHPWeather calculated a negative humidty value (it was somewhere in the -90% range). I did a little research and found another formula for calculating relative humidity from the temp and dew point and implemented it in my copy of phpweather. The result came out correct (it was the same as our National Weather Service had calculated on their web page), and was also correct for several other weather stations. Also, the code is probably more efficient as it is only doing 2 pow() calculations rather than 8. This is your original code: $decoded_metar['rel_humidity'] = number_format(100 * ( 610.710701 + 44.4293573 * $decoded_metar['dew_c'] + 1.41696846 * pow($decoded_metar['dew_c'], 2) + 0.0274759545 * pow($decoded_metar['dew_c'], 3) + 2.61145937E-4 * pow($decoded_metar['dew_c'], 4) + 2.85993708E-6 * pow($decoded_metar['dew_c'], 5) ) / ( 610.710701 + 44.4293573 * $decoded_metar['temp_c'] + 1.41696846 * pow($decoded_metar['temp_c'], 2) + 0.0274759545 * pow($decoded_metar['temp_c'], 3) + 2.61145937E-4 * pow($decoded_metar['temp_c'], 4) + 2.85993708E-6 * pow($decoded_metar['temp_c'], 5) ), 1); This is my new code: $decoded_metar['rel_humidity'] = number_format(100 * (6.11*(pow(10,(7.5*$decoded_metar['dew_c']/(237.7+$decoded_metar['dew_c']))) )) / (6.11*(pow(10,(7.5*$decoded_metar['temp_c']/(237.7+$decoded_metar['temp_c']) )))) ,1); The only thing I haven't done is to not calculate the RH if one or the other temp is missing (PAKP is currently not showing a dew point in the METAR). Also, for my purposes, I have removed the thousand's separator from the air pressure calculation. It was hampering a reformat of the data for my project. I hope this helps your efforts! Thanks, James Wiles kk...@nc... - White County, AR, USA _______________________________________________ PHPWeather-devel mailing list PHP...@li... https://lists.sourceforge.net/lists/listinfo/phpweather-devel |
From: James a. J. W. <kk...@nc...> - 2002-02-01 04:22:18
|
In using PHPWeather for an amateur-radio project I am working on, I came across a situation where the humidity was being incorrectly calculated. This afternoon, for the station PAPK (Anaktuvuk Pass, AK--I just picked it at random!), PHPWeather calculated a negative humidty value (it was somewhere in the -90% range). I did a little research and found another formula for calculating relative humidity from the temp and dew point and implemented it in my copy of phpweather. The result came out correct (it was the same as our National Weather Service had calculated on their web page), and was also correct for several other weather stations. Also, the code is probably more efficient as it is only doing 2 pow() calculations rather than 8. This is your original code: $decoded_metar['rel_humidity'] = number_format(100 * ( 610.710701 + 44.4293573 * $decoded_metar['dew_c'] + 1.41696846 * pow($decoded_metar['dew_c'], 2) + 0.0274759545 * pow($decoded_metar['dew_c'], 3) + 2.61145937E-4 * pow($decoded_metar['dew_c'], 4) + 2.85993708E-6 * pow($decoded_metar['dew_c'], 5) ) / ( 610.710701 + 44.4293573 * $decoded_metar['temp_c'] + 1.41696846 * pow($decoded_metar['temp_c'], 2) + 0.0274759545 * pow($decoded_metar['temp_c'], 3) + 2.61145937E-4 * pow($decoded_metar['temp_c'], 4) + 2.85993708E-6 * pow($decoded_metar['temp_c'], 5) ), 1); This is my new code: $decoded_metar['rel_humidity'] = number_format(100 * (6.11*(pow(10,(7.5*$decoded_metar['dew_c']/(237.7+$decoded_metar['dew_c']))))) / (6.11*(pow(10,(7.5*$decoded_metar['temp_c']/(237.7+$decoded_metar['temp_c']))))) ,1); The only thing I haven't done is to not calculate the RH if one or the other temp is missing (PAKP is currently not showing a dew point in the METAR). Also, for my purposes, I have removed the thousand's separator from the air pressure calculation. It was hampering a reformat of the data for my project. I hope this helps your efforts! Thanks, James Wiles kk...@nc... - White County, AR, USA |
From: Ray v. B. <r_v...@ho...> - 2002-01-30 20:46:39
|
Hi all! My hosting provider runs php 3.0.3 (I know, I know!). Phpweather 1.59 does not run on this php, it crashes to some functions that are used (like extract and str_replace). Was there some previous phpweather version that ran on php 3.0.3? Or do I have to 'down-tune' the latest version to make it work? Regards, Ray _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx |
From: Martin G. <gim...@gi...> - 2002-01-02 22:13:23
|
Steven Chalker <len...@ya...> writes: > Is there a METAR Program that can Encode "Westminster, MD, USA" ? > > Because I'd really like it. -Steven Try taking a look at this page: http://weather.noaa.gov/weather/MD_cc_us.html I couldn't find Westminster under 'Current weather conditions', but you might be able to find another city close by. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |
From: Steven C. <len...@ya...> - 2001-12-26 15:44:22
|
Is there a METAR Program that can Encode "Westminster, MD, USA" ? Because I'd really like it. -Steven Steven Chalker ( Kitty Hawk Spaceship Launching in.. 10..9..8..7..6..5..4..3..2..1.. ZERO! Launch Began, Kitty Hawks are in space!) --------------------------------- Do You Yahoo!? Send your FREE holiday greetings online at Yahoo! Greetings. |
From: Martin G. <gim...@gi...> - 2001-12-18 21:53:45
|
"Max Hammond" <ma...@fl...> writes: > Hi, > > attached a diff of db_mysql, that fixes things so that it works properly :) > > Some of the SQL still said "metars" instead of >$this->properties['db_metars'] Cool - I think this is the first patch to arrive at this list :-) Thanks a lot - I've just applied it. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |
From: Martin G. <gim...@gi...> - 2001-12-18 21:45:12
|
Yann Gascard <yan...@in...> writes: > Hello, > > I'd like to know what's the port number to allow in > our firewall for PHP weather to work. All PHP Weather does is to access files via HTTP. This normally uses port 80. But if you're using a proxyserver, then you have to connect to that on some other port - Squid uses 3128 but I've seen others use 8080. > Could you confirm that it's port number 3128, could someone confirm. If you're able to browse the net without using a proxy, then PHP Weather should also be able to function without any special settings. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |
From: Max H. <ma...@fl...> - 2001-12-18 21:44:33
|
Hi Yann, If you need to allow a hole in a firewall, it'll be port 80, for the http connection. If you're using a proxy, then it depends. 3128 is the default for squid. Look at the configuration for phpweather, is it set to use a proxy? If so, you need to allow whatever port it's set to to whatever machine it's set to. If not, you need to allow connections to port 80 on weather.noaa.gov from any port >1024 locally. Max > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Yann > Gascard > Sent: 18 December 2001 17:20 > To: php...@gi... > Subject: FW port number > > > Hello, > > I'd like to know what's the port number to allow in our > firewall for PHP weather to work. > Could you confirm that it's port number 3128, could someone confirm. > > Thx. > Yann. > > > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel > |
From: Yann G. <yan...@in...> - 2001-12-18 17:20:43
|
Hello, I'd like to know what's the port number to allow in our firewall for PHP weather to work. Could you confirm that it's port number 3128, could someone confirm. Thx. Yann. |
From: Max H. <ma...@fl...> - 2001-12-18 09:35:13
|
Hi, attached a diff of db_mysql, that fixes things so that it works properly :) Some of the SQL still said "metars" instead of $this->properties['db_metars'] Max |
From: Martin G. <gim...@gi...> - 2001-12-02 17:38:25
|
<m.z...@an...> writes: > Hi, > > I'm looking for a similar php program to decode TAF. > Any suggestions? PHP Weather can't decode TAFs in it's current form. I've only looked a little at how TAFs are encoded, but I think they're similar to METARs. If so, then I guess that it's possible to make PHP Weather decode them as well. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |
From: <m.z...@an...> - 2001-11-17 14:59:06
|
Hi, I'm looking for a similar php program to decode TAF. Any suggestions? Thanks, Mindaugas |
From: Webmaster <web...@da...> - 2001-11-14 10:35:52
|
Thank for this great script. It would be helpful to have some sort of list of variables in the $data associative array. Thanks. |
From: GYULAI M. <gy...@fb...> - 2001-11-03 17:42:42
|
Ray Saldana III írta, 2001-11-02, 19:09-kor kelt levelében, ami 65 sorból állt: Hello Ray! > Is there a way to control what PHP Weather displays by editing the > include file? Such as for sites in the United States to just show the > non metric measurements, and the ones outside of the US show the > metric ones? You either choose metric, or non-metric, and this choosing is global to all sites. But if you want to edit the source files, you could do it... -- GYULAI Mihály http://gyulai.freeyellow.com/ linux szkriptek, Mutt kézikönyv, Rejtő Jenő, Micimackó, Pál utcai fiúk, SWAT játék FAQ http://counter.li.org/ Linux Counter - Linux felhasználók számlálója |
From: Ray S. I. <ab...@ho...> - 2001-11-03 02:10:39
|
Hello everyone! Is there a way to control what PHP Weather displays by editing the = include file? Such as for sites in the United States to just show the = non metric measurements, and the ones outside of the US show the metric = ones? I noticed that in assigning the array it seems to do it in = sequence, so I would think in removing one, you would upset the whole = thing and have the incorrect measurements in the incorrect places. I was hoping to clean the display just a bit. I also noticed the = HTML tags in here, so would simply commenting out this section work with = a hidden tag? Thanks again! Ray Saldana IIII RRIS http://www.rottenray.com |
From: Tamsin <ph...@ta...> - 2001-10-27 20:35:36
|
> > It is incredibly terrible trying to get through this list of >cities to get the one that I need. I would be deeply in the >gratitude of anyone that could pass me this information! It is just >the way that the form is coded in is unfriendly to my screen reader. Hi, I've also been playing with PHPWeather, and have done a graphical version, which isn't really much help to you, but, I was trying to make a version of my code easily accessible by search engines, so I came up with a text based page with all the countries on, if you then click on the link you get a list of all the reporting cities in that country (or in the case of the US, you get a state selection and then the cities in that state).... For the whole list: http://tamsin.com/weather/?page=list and for Arizona: http://tamsin.com/weather/?page=list&loc=&country=United+States&state=AZ#AZ Hope this helps. T. -- The future's bright, the future's orange! http://www.tamsin.com |
From: Ray S. I. <ab...@ho...> - 2001-10-26 19:38:44
|
Hello to all on the PHP Weather list, I have a unique circumstance and I = wonder if someone can help me. I am using php Weather but I am a blind = webmaster. The problem is looking up the city lists. I live in Tucson, = and use KTUS for the airport here, but I am unable to look up the other = cites because of the way the file handles requests. When using the = keyboard if I try to go down the list and highlight the city I am = looking for focus is immediately passed to this control and it brings up = the city that is highlighted, so to get to a city way down the list, I = have to open all of the cities all of the way down and this is terrible. = Does anyone have the city codes for all of the reporting airports? I = would be deeply indebted to you if you could pass me the codes for the = different airports! It is incredibly terrible trying to get through this list of cities = to get the one that I need. I would be deeply in the gratitude of anyone = that could pass me this information! It is just the way that the form is = coded in is unfriendly to my screen reader. Thank you! Ray Saldana IIII RRIS http://www.rottenray.com |