[PHP] running out of memory processing result set on Linux, but not on Solaris
I have an app that runs just fine on an older Solaris apache server (Apache/2.0.53 PHP/5.0.4), but when I run the same app on a newer Linux server (Apache/2.2.3-11 PHP/5.2.8) against the same database on the same mysql server, it fails with "Allowed memory size exhausted". This occurs on a: $result = mysql_query($query, $db) statement. Both servers are running the identical query, which returns a result set under 0.5M. The Solaris server is configured with memory_limit = 8M in php.ini, and the Linux one with 32M, so clearly something other then what I'm seeing is going on. Anyone know what could be causing this? Any php or apache build or config options that I could look at? TIA! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] running out of memory processing result set on Linux, but not on Solaris
On Tue, Jul 13, 2010 at 11:11 AM, Ashley Sheridan wrote: > > On Tue, 2010-07-13 at 11:06 -0600, Larry Martell wrote: > > I have an app that runs just fine on an older Solaris apache server > (Apache/2.0.53 PHP/5.0.4), but when I run the same app on a newer > Linux server (Apache/2.2.3-11 PHP/5.2.8) against the same database on > the same mysql server, it fails with "Allowed memory size exhausted". > This occurs on a: > > $result = mysql_query($query, $db) > > statement. Both servers are running the identical query, which returns > a result set under 0.5M. The Solaris server is configured with > memory_limit = 8M in php.ini, and the Linux one with 32M, so clearly > something other then what I'm seeing is going on. Anyone know what > could be causing this? Any php or apache build or config options that > I could look at? > > TIA! > > > Is there any other place which your code is changing the memory_limit > parameter? I would assume this is unlikely, but sometimes even the unlikely > happens more than than it should! The error message actually says "Allowed memory size of 3355432 bytes exhausted" so I know it's using the 32M that it's set to php.ini. But as I wrote above, on the Solaris server where it works, the memory_limit is set to 8M. > Can you maybe strip the code down to a test case which causes the error? I've already done that - all it does it run a query and display the results. > Lastly, I do notice that you've got two different versions of PHP & Apache > installed on each OS, which could be the reason for the failure. Well, yes, that's what I said. And they may been built with different config options. But what options could cause a difference like this? > Maybe set up a VM or two to test things out. Have one VM with Solaris and > Apache/2.2.3-11 & PHP/5.2.8, and another VM with Apache/2.0.53 & PHP/5.0.4 > and see what happens. It could be that it's either Apache or PHP or both > causing the problems on your Linux system. I don't have control of that. This is at a client site - they want to get rid of their existing older Solaris apache server and move to a newer Linux one. The servers are already set up they way they are. I asked the admis for info on the build - they have it for the newer Linux one, but not for the older Solaris one. They did give me another machine to test on - that one is Linux, Apache 2.2.3, PHP 5.2.6 - that also gets the out of memory error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Retaining scroll position after asynchronous refresh
Hello all- I have a php script that generates a web page with a bunch of scrollable frames, and then asynchronously refreshes the page. If the user has scrolled down in any of the frames, when the refresh occurs it has scrolled back to the top of all the frames. Is there a way I can retain the scroll position so after the refresh the frames are shown at the same location as before the refresh? I have googled and googled for this, but everything I find is ASP or C# or Java. My stuff is straight php/html. How can I do this with that? TIA! -larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text messaging from the web
On Thu, Oct 14, 2010 at 9:45 AM, Paul M Foster wrote: > Folks: > > Being fairly geezerly, I know almost nothing about this, so be gentle. > > Assuming someone entered information in a form on a website. Normally, > you would email the responses to someone. But what if you wanted to > send this information to a smartphone via text messaging? > > Is this possible, given normal programming tools (PHP/Javascript), or > would you have to go through some commercial web to text messaging > gateway? Does anyone know if this could be done, and how? You can send a text message via email: Verizon: 10digitphonenum...@vtext.com AT&T: 10digitphonenum...@txt.att.net Sprint: 10digitphonenum...@messaging.sprintpcs.com T-Mobile: 10digitphonenum...@tmomail.net Nextel: 10digitphonenum...@messaging.nextel.com Cingular: 10digitphonenum...@cingularme.com Virgin Mobile: 10digitphonenum...@vmobl.com Alltel: 10digitphonenum...@message.alltel.com CellularOne: 10digitphonenum...@mobile.celloneusa.com Omnipoint: 10digitphonenum...@omnipointpcs.com Qwest: 10digitphonenum...@qwestmp.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text messaging from the web
On Thu, Oct 14, 2010 at 10:01 AM, Sebastian Detert wrote: > Larry Martell schrieb: > > On Thu, Oct 14, 2010 at 9:45 AM, Paul M Foster > wrote: > > > Folks: > > Being fairly geezerly, I know almost nothing about this, so be gentle. > > Assuming someone entered information in a form on a website. Normally, > you would email the responses to someone. But what if you wanted to > send this information to a smartphone via text messaging? > > Is this possible, given normal programming tools (PHP/Javascript), or > would you have to go through some commercial web to text messaging > gateway? Does anyone know if this could be done, and how? > > > You can send a text message via email: > > Verizon: 10digitphonenum...@vtext.com > AT&T: 10digitphonenum...@txt.att.net > Sprint: 10digitphonenum...@messaging.sprintpcs.com > T-Mobile: 10digitphonenum...@tmomail.net > Nextel: 10digitphonenum...@messaging.nextel.com > Cingular: 10digitphonenum...@cingularme.com > Virgin Mobile: 10digitphonenum...@vmobl.com > Alltel: 10digitphonenum...@message.alltel.com > CellularOne: 10digitphonenum...@mobile.celloneusa.com > Omnipoint: 10digitphonenum...@omnipointpcs.com > Qwest: 10digitphonenum...@qwestmp.com > > > > Me again ;) Is that for free? I just found this interesting site: > http://www.tech-faq.com/how-to-send-text-messages-free.html Yes, you can send text messages for free this way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text messaging from the web
On Thu, Oct 14, 2010 at 10:29 AM, Sebastian Detert wrote: > Larry Martell schrieb: > > On Thu, Oct 14, 2010 at 10:01 AM, Sebastian Detert > wrote: > > > Larry Martell schrieb: > > On Thu, Oct 14, 2010 at 9:45 AM, Paul M Foster > wrote: > > > Folks: > > Being fairly geezerly, I know almost nothing about this, so be gentle. > > Assuming someone entered information in a form on a website. Normally, > you would email the responses to someone. But what if you wanted to > send this information to a smartphone via text messaging? > > Is this possible, given normal programming tools (PHP/Javascript), or > would you have to go through some commercial web to text messaging > gateway? Does anyone know if this could be done, and how? > > > You can send a text message via email: > > Verizon: 10digitphonenum...@vtext.com > AT&T: 10digitphonenum...@txt.att.net > Sprint: 10digitphonenum...@messaging.sprintpcs.com > T-Mobile: 10digitphonenum...@tmomail.net > Nextel: 10digitphonenum...@messaging.nextel.com > Cingular: 10digitphonenum...@cingularme.com > Virgin Mobile: 10digitphonenum...@vmobl.com > Alltel: 10digitphonenum...@message.alltel.com > CellularOne: 10digitphonenum...@mobile.celloneusa.com > Omnipoint: 10digitphonenum...@omnipointpcs.com > Qwest: 10digitphonenum...@qwestmp.com > > > > Me again ;) Is that for free? I just found this interesting site: > http://www.tech-faq.com/how-to-send-text-messages-free.html > > > Yes, you can send text messages for free this way. > > > > I just tried it. I guess, it is only possible to use those E-Mails if you > are a customer of that phone company, right? I tried it with my own provider > (O2 germany), > sending an email to phonenum...@o2online.de failed, I had to activate that > serviceby sending +OPEN to 6245, but every email to sms costs money ... > Are you sure it is possible to send sms to phones around the world to any > provider? How do u distinguish between provider and country? > > I'm sorry if I'm asking stupid stuff I have no idea how it works in other countries or with every single provider. I do know that here in the US I do it all the time with the carriers I listed above. I have cron based monitors that text people via email when there are problems. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text messaging from the web
On Thu, Oct 14, 2010 at 9:56 AM, chris h wrote: >> You can send a text message via email: >> Verizon: 10digitphonenum...@vtext.com >> AT&T: 10digitphonenum...@txt.att.net >> Sprint: 10digitphonenum...@messaging.sprintpcs.com >> T-Mobile: 10digitphonenum...@tmomail.net >> Nextel: 10digitphonenum...@messaging.nextel.com >> Cingular: 10digitphonenum...@cingularme.com >> Virgin Mobile: 10digitphonenum...@vmobl.com >> Alltel: 10digitphonenum...@message.alltel.com >> CellularOne: 10digitphonenum...@mobile.celloneusa.com >> Omnipoint: 10digitphonenum...@omnipointpcs.com >> Qwest: 10digitphonenum...@qwestmp.com >> > > Larry, it seems like this method would only be useful if you knew the > carrier of a specific number. Do you know of a way to determine that? http://www.fonefinder.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reminder On Mailing List Rules
On Thu, Oct 21, 2010 at 1:37 PM, sueandant wrote: > Hi > > I'm not familiatr with the term "top-post"; could you please explain? http://idallen.com/topposting.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What's happened to our newsgroup?
On Tue, Jun 26, 2012 at 1:30 PM, TR Shaw wrote: > > On Jun 26, 2012, at 3:28 PM, Steven Staples wrote: > >> >>> -Original Message- >>> From: Govinda [mailto:govinda.webdnat...@gmail.com] >>> Sent: June 26, 2012 3:25 PM >>> To: PHP-General List >>> Subject: Re: [PHP] What's happened to our newsgroup? >>> >>> No postings for days. >>> >>> everyone RTFM? >>> :-) >>> >>> >> >> Maybe they joined the British mailing list? >> > > Maybe its just the summer. Maybe they're working in Django now (like I am). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Formatting -- defining sections of code
On Fri, Dec 14, 2012 at 11:20 AM, Paul M Foster wrote: > On Fri, Dec 14, 2012 at 10:48:05AM -0500, Andy McKenzie wrote: > >> Hey folks, kind of a strange question here. >> >> Basically, I've been trying to move my style from "self taught" to "Oh >> yeah, there IS a standard for this." One of the things I frequently >> want to do is define sections of my code: to take a simplistic >> example, "this outputs everything that needs to be in file A, this >> outputs what needs to be in file B," and so on. >> >> Up until now, I've used my own standards (generally " >> SectionName", since it's easy to search for). But it occurs to me to >> wonder; IS there a standard for this? Most likely, the programming >> world being what it is, there either isn't one or there are lots of >> competing standards, but I'd be interested to know... > > A *standard* for something? ROTFL! Yeah, like there's a standard for > herding cats! [guffaw] The nice thing about standards is that there are so many of them to choose from. -Andrew S. Tanenbaum -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Affordable low-fee e-commerce - DIY?
On Mon, Feb 18, 2013 at 1:26 PM, George Langley wrote: > Hi all. Am wanting to build a site where people can donate $1.00 but is not > for charity or other non-profit per se. So if I use PayPal, with their 2.9% + > .30 per transaction fee, that equals .33 cents for each dollar - that's a > full third of the amount the people would be giving. Credit cards appear to > be similar, with some percantage and about .22 cents per transactions. > Am wondering what other options I'm missing, that won't take such a chunk out > of the low price? Is it easy enough to code to some other API for free (or at > least cheaper)? Doesn't paypal only charge when someone pays with a credit card? If they pay out of their bank account there is no charge to the recipient. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date weirdness
I think I am losing my mind. I have some time zone converting code, and I just don't understand what I am seeing. Also my system seems to return the wrong time after I do some date operations on unrelated objects. This is from a machine that is in eastern time. I want to convert to, for example central time: $ndate = new Date(date("Y-m-d H:i:s")); echo $ndate->format("%Y-%m-%d %H:%M:%S"); 2013-03-28 15:35:07 <- this is the correct time $ndate->setTZbyID("EDT"); echo $ndate->format("%Y-%m-%d %H:%M:%S"); 2013-03-28 15:35:07 <- still correct $ndate->convertTZbyID("US/Central"); echo $ndate->format("%Y-%m-%d %H:%M:%S"); 2013-03-28 10:35:07 <- this is wrong it should be 14:35:07 $xdate = new Date(date("Y-m-d H:i:s")); echo $xdate->format("%Y-%m-%d %H:%M:%S"); 2013-03-28 19:35:07 <- HUH? This is wrong - should be 15:35:07 What in the world is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date weirdness
On Thu, Mar 28, 2013 at 2:44 PM, Steven Staples wrote: >> I think I am losing my mind. I have some time zone converting code, and I >> just don't understand what I am seeing. Also my system seems to return the >> wrong time after I do some date operations on unrelated objects. >> >> This is from a machine that is in eastern time. I want to convert to, for >> example central time: >> >> $ndate = new Date(date("Y-m-d H:i:s")); >> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >> 2013-03-28 15:35:07 <- this is the correct time >> >> $ndate->setTZbyID("EDT"); >> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >> 2013-03-28 15:35:07 <- still correct >> >> $ndate->convertTZbyID("US/Central"); >> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >> 2013-03-28 10:35:07 <- this is wrong it should be 14:35:07 >> >> $xdate = new Date(date("Y-m-d H:i:s")); >> echo $xdate->format("%Y-%m-%d %H:%M:%S"); >> 2013-03-28 19:35:07 <- HUH? This is wrong - should be 15:35:07 >> >> What in the world is going on here? >> > > I found this function a while back when I was converting UTC to EST... simple > task I know, but still... > > ( I am sorry to whomever wrote this, I didn't keep the source where I found > it ) > > function convert_time_zone($date_time, $from_tz = 'UTC', $to_tz = > 'America/Toronto') > { > $time_object = new DateTime($date_time, new DateTimeZone($from_tz)); > $time_object->setTimezone(new DateTimeZone($to_tz)); > return $time_object->format('Y-m-d H:i:s'); > } I don't seem to have the DateTime object. We are running 5.1.6 and that was added in 5.2.0. We are getting the Date module from an external extension. I'll have to see about upgrading. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date weirdness
On Thu, Mar 28, 2013 at 4:55 PM, Maciek Sokolewicz wrote: > On 28-3-2013 22:40, Larry Martell wrote: >> >> On Thu, Mar 28, 2013 at 2:44 PM, Steven Staples wrote: >>>> >>>> I think I am losing my mind. I have some time zone converting code, and >>>> I >>>> just don't understand what I am seeing. Also my system seems to return >>>> the >>>> wrong time after I do some date operations on unrelated objects. >>>> >>>> This is from a machine that is in eastern time. I want to convert to, >>>> for >>>> example central time: >>>> >>>> $ndate = new Date(date("Y-m-d H:i:s")); >>>> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >>>> 2013-03-28 15:35:07 <- this is the correct time >>>> >>>> $ndate->setTZbyID("EDT"); >>>> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >>>> 2013-03-28 15:35:07 <- still correct >>>> >>>> $ndate->convertTZbyID("US/Central"); >>>> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >>>> 2013-03-28 10:35:07 <- this is wrong it should be 14:35:07 >>>> >>>> $xdate = new Date(date("Y-m-d H:i:s")); >>>> echo $xdate->format("%Y-%m-%d %H:%M:%S"); >>>> 2013-03-28 19:35:07 <- HUH? This is wrong - should be 15:35:07 >>>> >>>> What in the world is going on here? >>>> >>> >>> I found this function a while back when I was converting UTC to EST... >>> simple task I know, but still... >>> >>> ( I am sorry to whomever wrote this, I didn't keep the source where I >>> found it ) >>> >>> function convert_time_zone($date_time, $from_tz = 'UTC', $to_tz = >>> 'America/Toronto') >>> { >>> $time_object = new DateTime($date_time, new >>> DateTimeZone($from_tz)); >>> $time_object->setTimezone(new DateTimeZone($to_tz)); >>> return $time_object->format('Y-m-d H:i:s'); >>> } >> >> >> I don't seem to have the DateTime object. We are running 5.1.6 and >> that was added in 5.2.0. We are getting the Date module from an >> external extension. I'll have to see about upgrading. >> > Well, if you're getting the Date class from a custom extension, then we > can't help you. Simply because we have no clue what the extension's code is. > > Also, please ask your host to upgrade, 5.1.6 is hopelessly outdated (and > unsupported!). The current version is 5.4 with 5.5 coming out very very > soon. > The extension is this: http://pear.php.net/package/Date/docs/latest/Date/Date.html - but that is also a very old version. I am working on getting the upgrade done. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] timezone
I have a client that has an app the runs with PHP 5.1.6. They want to upgrade to 5.3.3. First issue I ran into, they have a line of code that is: $deftz = date("T"); I'm getting this for that line: [Mon Apr 15 10:44:16 2013] [error] [client 10.7.14.21] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead in /home/www/itrade-dev/defs.inc on line 349 So I changed it to $deftz = date.timezone; and now I get: [Mon Apr 15 10:49:35 2013] [error] [client 10.7.14.21] PHP Notice: Use of undefined constant date - assumed 'date' in /home/www/itrade-dev/defs.inc on line 349 [Mon Apr 15 10:49:35 2013] [error] [client 10.7.14.21] PHP Notice: Use of undefined constant timezone - assumed 'timezone' in /home/www/itrade-dev/defs.inc on line 349 Why is this undefined? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timezone
On Mon, Apr 15, 2013 at 11:17 AM, Jonathan Sundquist wrote: > > > > On Mon, Apr 15, 2013 at 12:14 PM, Larry Martell > wrote: >> >> I have a client that has an app the runs with PHP 5.1.6. They want to >> upgrade to 5.3.3. First issue I ran into, they have a line of code >> that is: >> >> $deftz = date("T"); >> >> I'm getting this for that line: >> >> [Mon Apr 15 10:44:16 2013] [error] [client 10.7.14.21] PHP Warning: >> date(): It is not safe to rely on the system's timezone settings. You >> are *required* to use the date.timezone setting or the >> date_default_timezone_set() function. In case you used any of those >> methods and you are still getting this warning, you most likely >> misspelled the timezone identifier. We selected 'America/Denver' for >> 'MDT/-6.0/DST' instead in /home/www/itrade-dev/defs.inc on line 349 >> >> So I changed it to >> >> $deftz = date.timezone; >> >> and now I get: >> >> [Mon Apr 15 10:49:35 2013] [error] [client 10.7.14.21] PHP Notice: >> Use of undefined constant date - assumed 'date' in >> /home/www/itrade-dev/defs.inc on line 349 >> [Mon Apr 15 10:49:35 2013] [error] [client 10.7.14.21] PHP Notice: >> Use of undefined constant timezone - assumed 'timezone' in >> /home/www/itrade-dev/defs.inc on line 349 >> >> Why is this undefined? >> > You need to set the default time zone in this fashion, > > http://php.net/manual/en/function.date-default-timezone-set.php But I don't know the timezone - I'm trying to get it so I can convert times I get from the database to a user requested timezone. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timezone
On Mon, Apr 15, 2013 at 11:33 AM, Ashley Sheridan wrote: > You don't know which timezone the server is in? That's what it wants. No, I don't - this app runs in different locations all over the world. > Larry Martell wrote: >> >> On Mon, Apr 15, 2013 at 11:17 AM, Jonathan Sundquist >> wrote: >> >> >> >>> On Mon, Apr 15, 2013 at 12:14 PM, Larry Martell >>> wrote: >>> >>>> I have a client that has an app the runs with PHP 5.1.6. They want to >>>> upgrade to 5.3.3. First issue I ran into, they have a line of code >>>> that is: >>>> >>>> $deftz = date("T"); >>>> >>>> I'm getting this for that line: >>>> >>>> [Mon Apr 15 10:44:16 2013] [error] [client 10.7.14.21] PHP Warning: >>>> date(): It is not safe to rely on the system's timezone settings. You >>>> are *required* to use >>>> the date.timezone setting or the >>>> date_default_timezone_set() function. In case you used any of those >>>> methods and you are still getting this warning, you most likely >>>> misspelled the timezone identifier. We selected 'America/Denver' for >>>> 'MDT/-6.0/DST' instead in /home/www/itrade-dev/defs.inc on line 349 >>>> >>>> So I changed it to >>>> >>>> $deftz = date.timezone; >>>> >>>> and now I get: >>>> >>>> [Mon Apr 15 10:49:35 2013] [error] [client 10.7.14.21] PHP Notice: >>>> Use of undefined constant date - assumed 'date' in >>>> /home/www/itrade-dev/defs.inc on line 349 >>>> [Mon Apr 15 10:49:35 2013] [error] [client 10.7.14.21] PHP Notice: >>>> Use of undefined constant timezone - assumed 'timezone' in >>>> /home/www/itrade-dev/defs.inc on line 349 >>>> >>>> Why is this undefined? >>> >>> >>> You need to set the default time zone in this fashion, >>> >>> http://php.net/manual/en/function.date-default-timezone-set.php >> >> >> But I don't know the timezone - I'm trying to get it so I can convert >> times I get from the database to a user requested timezone. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timezone
On Mon, Apr 15, 2013 at 11:35 AM, Larry Martell wrote: > On Mon, Apr 15, 2013 at 11:33 AM, Ashley Sheridan > wrote: >> You don't know which timezone the server is in? That's what it wants. > > No, I don't - this app runs in different locations all over the world. I found some code at php.net that does this: date_default_timezone_set(@date_default_timezone_get()); $deftz = date('T'); And that is working for me and giving me what I need. >> Larry Martell wrote: >>> >>> On Mon, Apr 15, 2013 at 11:17 AM, Jonathan Sundquist >>> wrote: >>> >>> >>> >>>> On Mon, Apr 15, 2013 at 12:14 PM, Larry Martell >>>> wrote: >>>> >>>>> I have a client that has an app the runs with PHP 5.1.6. They want to >>>>> upgrade to 5.3.3. First issue I ran into, they have a line of code >>>>> that is: >>>>> >>>>> $deftz = date("T"); >>>>> >>>>> I'm getting this for that line: >>>>> >>>>> [Mon Apr 15 10:44:16 2013] [error] [client 10.7.14.21] PHP Warning: >>>>> date(): It is not safe to rely on the system's timezone settings. You >>>>> are *required* to use >>>>> the date.timezone setting or the >>>>> date_default_timezone_set() function. In case you used any of those >>>>> methods and you are still getting this warning, you most likely >>>>> misspelled the timezone identifier. We selected 'America/Denver' for >>>>> 'MDT/-6.0/DST' instead in /home/www/itrade-dev/defs.inc on line 349 >>>>> >>>>> So I changed it to >>>>> >>>>> $deftz = date.timezone; >>>>> >>>>> and now I get: >>>>> >>>>> [Mon Apr 15 10:49:35 2013] [error] [client 10.7.14.21] PHP Notice: >>>>> Use of undefined constant date - assumed 'date' in >>>>> /home/www/itrade-dev/defs.inc on line 349 >>>>> [Mon Apr 15 10:49:35 2013] [error] [client 10.7.14.21] PHP Notice: >>>>> Use of undefined constant timezone - assumed 'timezone' in >>>>> /home/www/itrade-dev/defs.inc on line 349 >>>>> >>>>> Why is this undefined? >>>> >>>> >>>> You need to set the default time zone in this fashion, >>>> >>>> http://php.net/manual/en/function.date-default-timezone-set.php >>> >>> >>> But I don't know the timezone - I'm trying to get it so I can convert >>> times I get from the database to a user requested timezone. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timezone
On Mon, Apr 15, 2013 at 1:59 PM, Lester Caine wrote: > Larry Martell wrote: >>> >>> No, I don't - this app runs in different locations all over the world. >> >> I found some code at php.net that does this: >> >> date_default_timezone_set(@date_default_timezone_get()); >> $deftz = date('T'); >> >> And that is working for me and giving me what I need. > > > But do you ACTUALLY know what time zone is stored IN the database? What if > te database was from another server? > > One of the 'standards' adopted when working world wide is to ensure what is > stored IN the database is always UTC based. So you can always compare times > on the same consistent base. The only time you need the offset is to display > a local time, and that is either the time local to the server, or the time > local to the client. > > The 'default' timezone is not necessarily the right one in either case ;) I misspoke - the data in the db is in UTC. This is used to covert the time of day on the server to the user's local timezone. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] timezone
On Mon, Apr 15, 2013 at 2:57 PM, Maciek Sokolewicz wrote: > On 15-4-2013 22:12, Larry Martell wrote: >> >> On Mon, Apr 15, 2013 at 1:59 PM, Lester Caine wrote: >>> >>> Larry Martell wrote: >>>>> >>>>> >>>>> No, I don't - this app runs in different locations all over the world. >>>> >>>> >>>> I found some code at php.net that does this: >>>> >>>> date_default_timezone_set(@date_default_timezone_get()); >>>> $deftz = date('T'); >>>> >>>> And that is working for me and giving me what I need. >>> >>> >>> >>> But do you ACTUALLY know what time zone is stored IN the database? What >>> if >>> te database was from another server? >>> >>> One of the 'standards' adopted when working world wide is to ensure what >>> is >>> stored IN the database is always UTC based. So you can always compare >>> times >>> on the same consistent base. The only time you need the offset is to >>> display >>> a local time, and that is either the time local to the server, or the >>> time >>> local to the client. >>> >>> The 'default' timezone is not necessarily the right one in either case ;) >> >> >> I misspoke - the data in the db is in UTC. This is used to covert the >> time of day on the server to the user's local timezone. >> > > You are aware that the code you used is really bad practice, right? You're > basically hiding the error "no default timezone set" by getting the default > timezone, which returns an error; surpressing that error, providing the > date_default_timezone_set function with the default value of > date_default_timezone_get if none is defined (which there should!!), being > "UTC". > > So in short, you're saying "set the default timezone to the default timezone > if no timezone is set, which I know there is not". That's very hard to > understand for future programmers reading your code. Why not just set > "date_default_timezone_set('UTC')". It's clear, resolves the warning and > works perfectly, instead of relying on vague defaults somewhere, in the hope > they're set right. > > On a sidenote; the reason why your original "fix" did not work: > $deftz = date.timezone; > Is because date.timezone is an ini setting. Not valid PHP code. And the > error actually tells you you need to SET date.timezone, not set a variable > TO the ini setting. In other words, you wanted date.timezone = "UTC" instead > of $tz = date.timezone (which makes no sense anyway) But UCT is not the timezone. When this app runs in New Mexico (where I am) it's Mountain time. When it runs in NY it's Eastern. When it runs in Tokyo it's JST, etc. The user has the option of setting the timezone all times are displayed in. They can select any timezone regardless of where they are. The app displays the last update time in the user selected TZ. So I have to convert the time I get from the server to that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP]
Continuing in my effort to port an app from PHP version 5.1.6 to 5.3.3, the app uses this construct all over the place when building links: I never could find any documentation for this, but I assumed it was some conditional thing - use $var if it's defined, otherwise use nothing. In 5.1.6 it seems to do just that. But in 5.3.3 I'm not getting the value of $var even when it is defined. Has this construct been deprecated? Is there now some other way to achieve this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On Wed, Apr 17, 2013 at 5:02 PM, Micky Hulse wrote: > On Wed, Apr 17, 2013 at 3:59 PM, Micky Hulse wrote: >> You might need to turn on the short tag option >> in your conf file. > > Sorry, ini file, not conf. Been a long day. :D > > I guess I should have asked if short tags are turned on for your 5.3.3? That was it. Thanks!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date weirdness
On Thu, Mar 28, 2013 at 3:40 PM, Larry Martell wrote: > On Thu, Mar 28, 2013 at 2:44 PM, Steven Staples wrote: >>> I think I am losing my mind. I have some time zone converting code, and I >>> just don't understand what I am seeing. Also my system seems to return the >>> wrong time after I do some date operations on unrelated objects. >>> >>> This is from a machine that is in eastern time. I want to convert to, for >>> example central time: >>> >>> $ndate = new Date(date("Y-m-d H:i:s")); >>> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >>> 2013-03-28 15:35:07 <- this is the correct time >>> >>> $ndate->setTZbyID("EDT"); >>> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >>> 2013-03-28 15:35:07 <- still correct >>> >>> $ndate->convertTZbyID("US/Central"); >>> echo $ndate->format("%Y-%m-%d %H:%M:%S"); >>> 2013-03-28 10:35:07 <- this is wrong it should be 14:35:07 >>> >>> $xdate = new Date(date("Y-m-d H:i:s")); >>> echo $xdate->format("%Y-%m-%d %H:%M:%S"); >>> 2013-03-28 19:35:07 <- HUH? This is wrong - should be 15:35:07 >>> >>> What in the world is going on here? >>> >> >> I found this function a while back when I was converting UTC to EST... >> simple task I know, but still... >> >> ( I am sorry to whomever wrote this, I didn't keep the source where I found >> it ) >> >> function convert_time_zone($date_time, $from_tz = 'UTC', $to_tz = >> 'America/Toronto') >> { >> $time_object = new DateTime($date_time, new DateTimeZone($from_tz)); >> $time_object->setTimezone(new DateTimeZone($to_tz)); >> return $time_object->format('Y-m-d H:i:s'); >> } > > I don't seem to have the DateTime object. We are running 5.1.6 and > that was added in 5.2.0. We are getting the Date module from an > external extension. I'll have to see about upgrading. I've upgraded to 5.3.3, got rid of the external Date extension and implement your solution. It's working perfectly. Thanks much! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems with array_push?
On Tue, May 7, 2013 at 3:06 PM, Jay Blanchard wrote: > I know that I must be missing something really ridiculous, but when I > print_r these arrays they are empty. I have confirmed that $arrayElement is > properly formed, it just seems that array_push is not working. I know I have > done this before, but I cannot find my older code. Can someone clear the mud > from my eyes? > > $issueDifferently = array(); > $issueProblem = array(); > $issueComment = array(); > > function addToArray($id, $namecred, $product, $level, $type, $message) { > $arrayElement = $id > .'|'.$namecred.'|'.$product.'|'.$level.'|'.$type.'|'.$message; > > if('DoDifferently' == $type) { > array_push($issueDifferently, $arrayElement); > } elseif ('Problem' == $type){ > array_push($issueProblem, $arrayElement); > } elseif ('Comments' == $type) { > array_push($issueComment, $arrayElement); > } > } > print_r($issueDifferently); > print_r($issueProblem); > print_r($issueComment); You have to declare the arrays as global inside your function. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ODBC
On Sun, May 19, 2013 at 9:06 AM, georg wrote: > Actually who the heck has put SELinux in my machine ? > > anyone knows (is this a part of fedora ?) Never used Fedora, but it's part of Red Hat and Centos, so would guess it's also part of fedora. You can disable SELinux with this: echo 0 > /selinux/enforce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /tmp/directory
On Mon, Jul 22, 2013 at 9:59 AM, Larry Martell wrote: > On Mon, Jul 22, 2013 at 9:50 AM, Tedd Sperling > wrote: >> On Jul 22, 2013, at 11:20 AM, Tedd Sperling wrote >>> Hi gang: >>> >>> I should know this, but I don't. >>> >>> Where is the /tmp/ directory? >>> >>> You see, I have a client where his host has apparently changed the /tmp/ >>> directory permissions such that old php/mysql scripts cannot write to the >>> /tmp/ directory anymore -- they did at one time. >>> >>> So, how do I fix it? >>> >>> Cheers, >>> >>> tedd >> >> Let me add -- the PHP version I am working with is 4.3.10. >> >> I know... > > df /tmp should show you where it's mounted. And sys_get_temp_dir() will tell you the path. # php /tmp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /tmp/directory
On Mon, Jul 22, 2013 at 9:50 AM, Tedd Sperling wrote: > On Jul 22, 2013, at 11:20 AM, Tedd Sperling wrote >> Hi gang: >> >> I should know this, but I don't. >> >> Where is the /tmp/ directory? >> >> You see, I have a client where his host has apparently changed the /tmp/ >> directory permissions such that old php/mysql scripts cannot write to the >> /tmp/ directory anymore -- they did at one time. >> >> So, how do I fix it? >> >> Cheers, >> >> tedd > > Let me add -- the PHP version I am working with is 4.3.10. > > I know... df /tmp should show you where it's mounted. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 11:35 AM, Joshua Kehn wrote: > On Sep 20, 2013, at 1:26 PM, Larry Martell > wrote: > >> On Fri, Sep 20, 2013 at 11:24 AM, Joshua Kehn wrote: >>> >>> >>> Slightly snobbish solution: Don't use windows. >> >> Unfortunately required to VPN into most of my clients corporate networks. > > Windows is required to VPN in? I'm guessing they use some proprietary client > then? --jk Yes, and/or they validate the host ID, and/or there's some soft key RSA thing involved. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 10:51 AM, Tedd Sperling wrote: > Hi gang: > > Do you use a Mousepad? > > My reason for asking is that I've used a Mousepad ever since mice first came > out (back when they had one ball). > > Now that mice are optical (no balls), Mousepads are not really needed -- or > so I'll told by the college -- you see, they don't provide Mousepads for > their student's computers. > > As such, I wondered what's the percentage of programmers still using a > Mousepad? > > Secondly, are Mousepads used primarily by older programmers (like me) while > younger programmers don't use Mousepads, or what? > > So -- please respond with: > > Age: * > Mousepad: Yes/No 54 Yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 11:16 AM, Joshua Kehn wrote: > On Sep 20, 2013, at 1:04 PM, Daniel Brown wrote: > >>I'm in my mid-thirties and - despite having an optical mouse - I >> do indeed still use a mousepad. A customized one that the wife did >> for me for Christmas one year: images of Futurama, the Cleveland >> Browns, Minnesota Vikings, and several aircraft, all surrounding a >> picture of her and our daughter. I've found that shiny surfaces - >> such as my desk - reflect too much of the laser, causing the mouse to >> be far less responsive. > I'm in my 20's and rarely, if ever, use a dedicated mouse. I've transitioned > to having all my workstations be laptops of one sort or another and they have > built-in trackpads. Of course I also rarely use the mouse when there are so > many keyboard shortcuts available. When I'm on my MacBook (which is most of the time) I use the trackpad. But in the unfortunate times I have to be on a Windows box I always connect a mouse. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 11:20 AM, Jen Rasmussen wrote: > -Original Message- > What in the heck is a Bag Bomb? It's a salve for cow udders. Not sure what a person would do with it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 11:24 AM, Joshua Kehn wrote: > > On Sep 20, 2013, at 1:23 PM, Larry Martell > wrote: > >> On Fri, Sep 20, 2013 at 11:16 AM, Joshua Kehn wrote: >>> >>> I'm in my 20's and rarely, if ever, use a dedicated mouse. I've >>> transitioned to having all my workstations be laptops of one sort or >>> another and they have built-in trackpads. Of course I also rarely use the >>> mouse when there are so many keyboard shortcuts available. >> >> When I'm on my MacBook (which is most of the time) I use the trackpad. >> But in the unfortunate times I have to be on a Windows box I always >> connect a mouse. > > Slightly snobbish solution: Don't use windows. Unfortunately required to VPN into most of my clients corporate networks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] framework or not
On Wed, Oct 23, 2013 at 10:26 AM, Tedd Sperling wrote: > On Oct 23, 2013, at 12:04 AM, Robert Cummings > wrote: > > > On 13-10-22 05:38 PM, Larry Garfield wrote: > >> If you need more convincing, I will cite Fred Brooks: > >> > >> http://www.cs.nott.ac.uk/~cah/G51ISS/Documents/NoSilverBullet.html > > > > Excellent article, thanks for the pointer. So many assertions have stood > the test of time thus far. > > > > Cheers, > > Rob. > > Yes, it was an excellent article. > > One of the things I liked about the article was the concept of > "Incremental Development", which is something I have practiced since the > Old Apple ][ days (Incidentally, he states he learned of this in 1958 -- is > that a typo?). > > In 1977, I started many of my programs with (pardon my failing memory of > AppleSoft syntax): > > Gosub GatherData() > Gosub ProcessData() > Gosub PresentDate() > END > > It ran, but didn't do anything. Incidentally, that resembles a one-pass > MVC design, does it not? > > In any event, I would flesh out the code until I got what I wanted. > > Maybe that's one of the reasons why Android or iOS Development starts with > a Default "Hello World" App that does very little than run. > > Start simple, develop complex. > Is there any other way to do it? I've been programming since 1975 and that's what I was taught and that's how always do it. Was it Brian Kernighan who said the 3 rules of programming are: 1. Keep it simple. 2. Build it in stages. 3. Let someone else do the hard part.
Re: [PHP] framework or not
On Wed, Oct 23, 2013 at 11:08 AM, Tedd Sperling wrote: > On Oct 23, 2013, at 12:34 PM, Larry Martell > wrote: > > Was it Brian Kernighan who said the 3 rules of programming are: > > > > 1. Keep it simple. > > 2. Build it in stages. > > 3. Let someone else do the hard part. > > Sounds good to me. > > I would also add: > > I've learned something new everyday of my life -- and I'm getting damned > tired of it. > > I'm looking forward to the day that I'll know everything and can stop all > this learning nonsense. > > "Everything that can be invented has been invented." -Charles H. Duell, Commissioner of US patent office, 1899.
Re: [PHP] iPhone sadness
On Mon, May 30, 2011 at 9:35 AM, Andre Polykanine wrote: > And, BTW, this bottom posting has started just two or three years ago > when Thunderbird came in place. You obviously have no clue what you are talking about. Since email began bottom posting was the standard. It wasn't until the sheeple who drink the Microsoft kool-aid came along that people started top-posting. And Thunderbird came out in 2003, not 'two or three years ago.' A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpsadness
On Fri, Jun 3, 2011 at 9:29 AM, Daniel Brown wrote: > On Thu, Jun 2, 2011 at 22:14, Paul M Foster wrote: >> On Thu, Jun 02, 2011 at 01:02:26PM -0400, Daniel Brown wrote: >> >>> On Tue, May 31, 2011 at 22:13, Bill Guion wrote: >>> > >>> > So if I understand, you want an explode() with empty parameters to explode >>> > the host machine? >>> >>> That's correct. If it causes too much userland confusion, we can >>> alias it as detonate() as well. >> >> It would be so hilarious if this made it into the docs as a (spoof) >> command. I could see some n00b skimming over the docs and going, "Wait, >> what--?" >> >> Oh-- how about if the detonate() command just echoed a series of "tick" >> strings to the web page? Can't you just imagine the frantic tech support >> calls from n00b PHP coders to the tech support departments of their >> hosting companies? "Oh crap oh crap! Pick up the phone already! Oh >> crap I'm so busted!" >> >> Reminds me (obliquely) of an entry in the index for "The C Programming >> Language" for recursion, which points right back to that index page. I >> about doubled over when I first discovered it. > > That's hilarious. I love subtle humor like that. Check out intercal: http://en.wikipedia.org/wiki/INTERCAL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Repetitive answers . . .
On Fri, Sep 9, 2011 at 12:36 PM, Daniel Brown wrote: > On Fri, Sep 9, 2011 at 14:30, Robert Cummings wrote: >> >> Oblig: http://www.youtube.com/watch?v=sUntx0pe_qI > > I didn't know it was possible to fill almost four minutes with a > single note, outside of a test pattern. That's got to be the worst > "singer" I've ever heard in my entire life. I agree, I only lasted 1 minute. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday Distraction
On Fri, Oct 21, 2011 at 11:38 AM, Tedd Sperling wrote: > On Oct 21, 2011, at 12:27 PM, Daniel Brown wrote: > >> I'll get this week's Friday distraction kicked off here with >> something shared with me by a Facebook friend. If you're on Facebook, >> try this. It's pretty sweet (and safe for work and kids). >> >> http://www.takethislollipop.com/ >> >> -- >> > > Not meaning to be ignorant, but why? > > What's the point here? > > I have grandkids and about a dozen other species of relatives/friends trying > to get me to do stuff (i.e., like/friend/post/reply/accept) on FaceBook et > al, but I don't see the point. It looks like a total waste of time. Why > should I care if someone post something on their FaceBook account? I would > rather spend my time programming, teaching programming, and reading about > programming. > > Maybe I'm just getting too old for this stuff. I couldn't agree more. It is a total waste of time, and for many people they think it replaces the need for personal contact. Like you, I have 100's of things I'd rather spend my time on. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Execute permission question
On Thu, Oct 27, 2011 at 2:26 PM, Tedd Sperling wrote: > Hi gang: > > Another question -- in the context of file permissions (rwx) is the execute > permission limited to shell commands -- Or -- is there more? Not sure I fully understand your question, but to execute anything directly - shell script, python script, perl script, binary program - you need the x bit set. I say directly because you could do: 'perl script' without script being executable (because in that case it's an argument to the perl executable). HTH, -larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Long Live GOTO
On Mon, Feb 6, 2012 at 9:23 AM, Alain Williams wrote: > On Mon, Feb 06, 2012 at 11:12:53AM -0500, Jim Giner wrote: >> NO "GO"! >> As one who started back in the 70's with old style coding that utilized GoTo >> in Cobol, Fortran, etc. and had to deal with "spaghetti code" written by >> even earlier developers who never considered that someone else would have to >> maintain their code, I feel strongly that GoTo is not to be used. > > I remember being faced with spaghetti code 35 odd years ago - yes, horrible. > But what do we mean by ''spaghetti code'' ? I remember code where every 3rd > statement was some form of GOTO - yuck! > > One very desirable feature of code is that it be clear, ie: lucid, able to be > understood by others. Too many GOTO statements and it is hard. > > However: a few GOTOs can make things clearer. Think of a function that can > fail > in several different places (eg data validation, ...). But it is reading a > file > which needs to be closed before the function returns. I have seen code where > some $IsError variable is tested in many places to see if things should be > done. > That is just as bad as lots of GOTO -- often when having to write something > like > that I will have a GOTO (in several places) to the bottom of the function that > closes the file and returns failure. > > That is much clearer than extra variables. > > If I survey my code I find that I use one GOTO in about 4,000 lines of code - > that I do not find excessive. > > There are, however, people who consider any GOTO as communion with the devil. > IMHO: not so - if used sparingly. Just for another data point, the FAA does not allow gotos in any code that goes into an airplane. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Long Live GOTO
On Mon, Feb 6, 2012 at 9:50 AM, Adam Richardson wrote: > On Mon, Feb 6, 2012 at 11:28 AM, Larry Martell > wrote: > >> On Mon, Feb 6, 2012 at 9:23 AM, Alain Williams wrote: >> > On Mon, Feb 06, 2012 at 11:12:53AM -0500, Jim Giner wrote: >> >> NO "GO"! >> >> As one who started back in the 70's with old style coding that utilized >> GoTo >> >> in Cobol, Fortran, etc. and had to deal with "spaghetti code" written by >> >> even earlier developers who never considered that someone else would >> have to >> >> maintain their code, I feel strongly that GoTo is not to be used. >> > >> > I remember being faced with spaghetti code 35 odd years ago - yes, >> horrible. >> > But what do we mean by ''spaghetti code'' ? I remember code where every >> 3rd >> > statement was some form of GOTO - yuck! >> > >> > One very desirable feature of code is that it be clear, ie: lucid, able >> to be >> > understood by others. Too many GOTO statements and it is hard. >> > >> > However: a few GOTOs can make things clearer. Think of a function that >> can fail >> > in several different places (eg data validation, ...). But it is >> reading a file >> > which needs to be closed before the function returns. I have seen code >> where >> > some $IsError variable is tested in many places to see if things should >> be done. >> > That is just as bad as lots of GOTO -- often when having to write >> something like >> > that I will have a GOTO (in several places) to the bottom of the >> function that >> > closes the file and returns failure. >> > >> > That is much clearer than extra variables. >> > >> > If I survey my code I find that I use one GOTO in about 4,000 lines of >> code - >> > that I do not find excessive. >> > >> > There are, however, people who consider any GOTO as communion with the >> devil. >> > IMHO: not so - if used sparingly. >> >> Just for another data point, the FAA does not allow gotos in any code >> that goes into an airplane. >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > Can I have the source for this so I can read the rationale? I'm curious > which language implementation it's referencing (C, Ada, etc.) and what > restrictions the language places on the construct. Again, the PHP version > of the construct is beneficially quite restrictive. For instance, some > people don't like giving programmers access to pointers just because you > can get into so much trouble with them, but I wonder if they'd be concerned > about Go's pointers, which don't allow pointer arithmetic, limiting one are > of potential trouble: > > http://golang.org/doc/go_for_cpp_programmers.html#Conceptual_Differences > > Interesting. The source is my own personal experience working for an avionics company and working with the FAA to get our code certified under the DO-178B standard. I never saw anything that said 'no GOTOs' but that's what I was told. I was also told no C++ was allowed nor was any recursion. This was important to me, as we had purchased some code that was all that (C++, with recursion and GOTOs) and I was given the task of rewriting it in C and removing the gotos and the recursion. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Long Live GOTO
On Mon, Feb 6, 2012 at 10:13 AM, Adam Richardson wrote: > On Mon, Feb 6, 2012 at 12:09 PM, Larry Martell > wrote: > >> >> The source is my own personal experience working for an avionics >> company and working with the FAA to get our code certified under the >> DO-178B standard. I never saw anything that said 'no GOTOs' but that's >> what I was told. I was also told no C++ was allowed nor was any >> recursion. This was important to me, as we had purchased some code >> that was all that (C++, with recursion and GOTOs) and I was given the >> task of rewriting it in C and removing the gotos and the recursion. >> > > Now that was probably a lot of work! Interesting that C++ was not allowed. > > Thanks for the background information, I was a lot of work, but I was a contractor getting paid by the hour ;-); I just pulled out my notes from that job - it took me 59 hours to do the conversion and remove the gotos and recursion, and another 67 hours for testing, verification, integration, documentation, and certification. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Long Live GOTO
On Mon, Feb 6, 2012 at 11:07 AM, Daniel Brown wrote: > On Mon, Feb 6, 2012 at 12:59, Larry Martell > wrote: >> >> I just pulled out my notes from that job - it took me 59 hours to do >> the conversion and remove the gotos and recursion, and another 67 >> hours for testing, verification, integration, documentation, and >> certification. > > And, having contracted with the federal government quite a bit > myself, 180 days for implementation, followed by 25 years of > upgrade-less utilization, then three years of deprecation and > near-replication, ending with an abandoned, government-grade, > bug-infested duplication, at the low-low cost of just $230 Million to > the nation. This was a job for a private company, and my code is in many aircraft flying in the sky right now. But I once did do a job for a company that was under contract to one of the branches of the military, and we did spend $100s of millions of the tax payers money to build a really cool inertial reference unit - unfortunately, we only built one, and then they didn't want it any more. I think I produced more power point slides then I did lines of code :-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php