|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
|
|
Multiple Loops in Lasso CodeI have a lasso file that has multiple levels of nested loops that
compares Zip codes for distance calculations. Recently Lasso, MySQL, or FireFox have been choking on the process. When I limit the number of loops to 2 for test purposes, it works, but letting it try the third loop causes everything to bog down and not finish the process. MySQL processes seem to show to be completed but the page never renders. Each nested loop contains a query and html is built accordingly. So often the process can go through hundreds of queries. On "limited loop" tests, there is so much white space (hidden lasso code) that the lines for the rendered source pages number in the thousands. Could I be hitting a browser limit? Is there a way to eliminate the lines of hidden Lasso code in the final html rendering? Could the finished output just get too big for Lasso to send back to the browser? I'm just not sure how to troubleshoot this since the code works through a couple of iterations of loops then gags. Not a MySQL genius so I'm not sure what settings I need to tweak there, if needed. Thanks for any input. Scott Brister -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Multiple Loops in Lasso CodeLasso code within a single set of delimiters ("[" and "]" or
"<?lassoscript" and "?>") do not produce whitespace. From your description, it sounds like the code is written like this: [if: (some condition)] [do something] [else] [do something else] [/if] ...and so on. If instead it were written like this: [ if(some condition); do something; else; do something else; /if; ] ...and so on, the resulting file would produce far, far less white space. That is something you have total control over as a developer. We have seen cases where extremely large/long pages did not render completely or correctly in Firefox. If that's the only browser you are seeing it in, and there's no indication of a problem from Lasso, MySQL, or your web server, my guess is all that extra whitespace is indeed the problem. - jason On Fri, Oct 23, 2009 at 9:05 AM, Scott Brister <rsb@...> wrote: > I have a lasso file that has multiple levels of nested loops that compares > Zip codes for distance calculations. Recently Lasso, MySQL, or FireFox have > been choking on the process. When I limit the number of loops to 2 for test > purposes, it works, but letting it try the third loop causes everything to > bog down and not finish the process. MySQL processes seem to show to be > completed but the page never renders. > > Each nested loop contains a query and html is built accordingly. So often > the process can go through hundreds of queries. On "limited loop" tests, > there is so much white space (hidden lasso code) that the lines for the > rendered source pages number in the thousands. Could I be hitting a browser > limit? Is there a way to eliminate the lines of hidden Lasso code in the > final html rendering? Could the finished output just get too big for Lasso > to send back to the browser? > > I'm just not sure how to troubleshoot this since the code works through a > couple of iterations of loops then gags. Not a MySQL genius so I'm not sure > what settings I need to tweak there, if needed. > > Thanks for any input. > > Scott Brister > > -- > This list is a free service of LassoSoft: http://www.LassoSoft.com/ > Search the list archives: http://www.ListSearch.com/Lasso/Browse/ > Manage your subscription: http://www.ListSearch.com/Lasso/ > > > -- tagSwap.net :: Open Source Lasso Code <http://tagSwap.net/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
|
|
|
Re: Multiple Loops in Lasso CodeMaybe you can post your code, or explain what it is you are trying to
do, then it can be rewritten instead of looping through loops. You're timing out, so it's a huge request you are doing. Maybe you can restructure your data to optimize this. On 2009-10-23, at 10:23 AM, Scott Brister wrote: > Script execution time limit exceeded while executing > 'Path_of_the_problem_file.lasso'. Killing thread B0081000 > Level: Critical ___________________________ Rich in Toronto (Home of LDC10) -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Multiple Loops in Lasso CodeOn Oct 23, 2009, at 10:23 AM, Scott Brister wrote: > Well, I'm not so great at Lasso administration either, apparently. I > have these types of errors in the Lasso log: > > Script execution time limit exceeded while executing > 'Path_of_the_problem_file.lasso'. Killing thread B0081000 > Level: Critical If you login to the Lasso Site Admin and go to "Setup > Site > Lasso Settings" You'll see a section titled "Thread Time Limit". You can tell it not to limit the time, or adjust how long it waits there. The default seems to be 600 seconds - are your pages taking longer than 10min. to load? > Message: MySQLDS failed connecting to MySQL. errno=2013 "Lost > connection to MySQL server during query" Is this before or after the timeout? If after, I would bet it's caused by the timeout. -Brad -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
|
|
|
|
|
|
|
|
|
Re: Multiple Loops in Lasso CodeScott Brister wrote on 10/23/2009 11:59 AM:
> The timeouts are occurring when I let the page churn, so yes, they are > taking more than 10 minutes. I'd obviously rather optimize than set a > longer limit, but I do appreciate the suggestion and may use it for > testing. Thank you. You can set the timeout limit for just that page using [Lasso_ExecutionTimeLimit] at the top of the page: http://reference.lassosoft.com/Reference.LassoApp?[Lasso_ExecutionTimeLimit] The issue with really long processing pages is the page will process in Lasso, but the web server gives up after a certain amount of time and returns an error to the browser anyhow... - Bil -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Multiple Loops in Lasso CodeAt 08:05 -0500 23/10/09, Scott Brister wrote:
>I have a lasso file that has multiple levels of nested loops that compares Zip codes for distance calculations. Recently Lasso, MySQL, or FireFox have been choking on the process. When I limit the number of loops to 2 for test purposes, it works, but letting it try the third loop causes everything to bog down and not finish the process. MySQL processes seem to show to be completed but the page never renders. At 13:57 -0500 23/10/09, Scott Brister wrote: >The time-out problem persists, however, even after that code clean up. (Jason replied to my first post before I sent the other indicating the time-out problems.) It doesn't sound as if you should need nested loops or inlines to do this. It would probably be best to do your distance calculations in MySQL. I think Bil Corry has posted SQL statements for this before. If not then I'm sure Google knows the correct SQL. Also, if you're doing a search along the lines of "zip codes within 20 miles of point x", don't forget that you can narrow down the number of rows that you need to perform the distance calculations on. If you want to find locations within a x mile radius you can search the database on (location_latitude BETWEEN (search_latitude - x) AND (search_latitude + x)) AND (location_longitude BETWEEN (search_longitude - x) AND (search_longitude + x)). That's an easy search for MySQL to do quickly with very few calculations involved and you exclude any locations lying outside the square area that encloses the circular area of your actual search radius. I was going to explain that further, but then it occurred to me that Google Images might do a better job. I was right! http://www.zipcodedownload.com/Documentation/DistanceWizard/images/Diagram.jpg HTH, James -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Multiple Loops in Lasso CodeIf your solution continues to bog down, I wrote something that
might be of use: http://stevepiercy.com/lasso_stuff/zipdist/distance.lasso --steve On 10/23/09 at 8:05 AM, rsb@... (Scott Brister) pronounced: >I have a lasso file that has multiple levels of nested loops >that compares Zip codes for distance calculations. Recently >Lasso, MySQL, or FireFox have been choking on the process. When >I limit the number of loops to 2 for test purposes, it works, >but letting it try the third loop causes everything to bog down >and not finish the process. MySQL processes seem to show to be >completed but the page never renders. > >Each nested loop contains a query and html is built >accordingly. So often the process can go through hundreds of >queries. On "limited loop" tests, there is so much white space >(hidden lasso code) that the lines for the rendered source >pages number in the thousands. Could I be hitting a browser >limit? Is there a way to eliminate the lines of hidden Lasso >code in the final html rendering? Could the finished output >just get too big for Lasso to send back to the browser? > >I'm just not sure how to troubleshoot this since the code works >through a couple of iterations of loops then gags. Not a MySQL >genius so I'm not sure what settings I need to tweak there, if needed. > >Thanks for any input. > >Scott Brister > >-- >This list is a free service of LassoSoft: http://www.LassoSoft.com/ >Search the list archives: http://www.ListSearch.com/Lasso/Browse/ >Manage your subscription: http://www.ListSearch.com/Lasso/ > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <web@...> <http://www.StevePiercy.com/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
|
|
|
Re: Multiple Loops in Lasso CodeAnd more information on techniques:
http://www.nabble.com/Postcode-Distance-Calculator-UK-tt5500708.html#a5500708 --steve On 10/23/09 at 1:43 PM, Web@... (Steve Piercy - Web Site Builder) pronounced: >If your solution continues to bog down, I wrote something that might be of use: > >http://stevepiercy.com/lasso_stuff/zipdist/distance.lasso > >--steve > > >On 10/23/09 at 8:05 AM, rsb@... (Scott Brister) pronounced: > >>I have a lasso file that has multiple levels of nested loops >>that compares Zip codes for distance calculations. Recently >>Lasso, MySQL, or FireFox have been choking on the process. >>When I limit the number of loops to 2 for test purposes, it >>works, but letting it try the third loop causes everything to >>bog down and not finish the process. MySQL processes seem to >>show to be completed but the page never renders. >> >>Each nested loop contains a query and html is built >>accordingly. So often the process can go through hundreds of >>queries. On "limited loop" tests, there is so much white space >>(hidden lasso code) that the lines for the rendered source >>pages number in the thousands. Could I be hitting a browser >>limit? Is there a way to eliminate the lines of hidden Lasso >>code in the final html rendering? Could the finished output >>just get too big for Lasso to send back to the browser? >> >>I'm just not sure how to troubleshoot this since the code >>works through a couple of iterations of loops then gags. Not a >>MySQL genius so I'm not sure what settings I need to tweak >>there, if needed. >> >>Thanks for any input. >> >>Scott Brister >> >>-- >>This list is a free service of LassoSoft: http://www.LassoSoft.com/ >>Search the list archives: http://www.ListSearch.com/Lasso/Browse/ >>Manage your subscription: http://www.ListSearch.com/Lasso/ >> >> > >-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- >Steve Piercy Web Site Builder Soquel, CA ><web@...> <http://www.StevePiercy.com/> > > >-- >This list is a free service of LassoSoft: http://www.LassoSoft.com/ >Search the list archives: http://www.ListSearch.com/Lasso/Browse/ >Manage your subscription: http://www.ListSearch.com/Lasso/ > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <web@...> <http://www.StevePiercy.com/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Multiple Loops in Lasso CodeOn Oct 23, 2009, at 3:55 PM, Scott Brister wrote: > Thank you for the reply. I am in the process of trying to optimize > the code and the suggestion of bracketing the latitude and longitude > is a nice idea. I'm assuming x in your example would be a > calculation involving the number of miles per degree of latitude and > longitude. I 'asked" Yahoo this question "how many miles in 1 degree latutude" and got this answer Degrees of latitude are parallel so the distance between each degree remains almost constant but since degrees of longitude are farthest apart at the equator and converge at the poles, their distance varies greatly. Each degree of latitude is approximately 69 miles (111 kilometers) apart. The range varies (due to the earth's slightly ellipsoid shape) from 68.703 miles (110.567 km) at the equator to 69.407 (111.699 km) at the poles. This is convenient because each minute (1/60th of a degree) is approximately one mile. A degree of longitude is widest at the equator at 69.172 miles (111.321) and gradually shrinks to zero at the poles. At 40° north or south the distance between a degree of longitude is 53 miles (85 km). Source(s): GEOGRAPHY TEACHER jp -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Multiple Loops in Lasso CodeAnd better yet ..use a zipcode database from a variety of available
sources ....zipcodes.com is one The database typcially has zipcoees, latittudes, longitutues, cities, states, counties, and lots of other goodies. jp -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Multiple Loops in Lasso CodeJames Harvard wrote on 10/23/2009 1:08 PM:
> Also, if you're doing a search along the lines of "zip codes within > 20 miles of point x", don't forget that you can narrow down the > number of rows that you need to perform the distance calculations on. > If you want to find locations within a x mile radius you can search > the database on (location_latitude BETWEEN (search_latitude - x) AND > (search_latitude + x)) AND (location_longitude BETWEEN > (search_longitude - x) AND (search_longitude + x)). > > That's an easy search for MySQL to do quickly with very few > calculations involved and you exclude any locations lying outside the > square area that encloses the circular area of your actual search > radius. > > I was going to explain that further, but then it occurred to me that > Google Images might do a better job. I was right! > http://www.zipcodedownload.com/Documentation/DistanceWizard/images/Diagram.jpg Yes, great image, that is the same technique that I describe here: http://www.nabble.com/Postcode-Distance-Calculator-UK-tt5500708.html#a5527559 - Bil -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
|
|
|
Re: Multiple Loops in Lasso CodeYou might want to consider getting an account with OpenDNS or any
other DNS service to bypass your ISP's own DNS servers. Usually, DNS issues are related to specifically network latency in my experience. Sometimes, the first 2 times doesn't get results, but the 3rd time does. It's when your router that is handling the network packets/traffic is trying to find the correct DNS server that has the domain name record to resolve to the IP address. jp -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
|
|
|
Re: Multiple Loops in Lasso CodeThere may be a firewall or proxy server between the remote user and Lasso that drops the connection after x seconds.
James >OK. Further clarification. The timeout problem occurs any time I'm out of my own network. I tried running this project by accessing my site via my external static IP address and the same problem occurs. So it's not DNS, but rather any time I'm accessing via my ISP. Again, accessing the site internally is not a problem. So it appears I need to talk to Cox and find out if they are throttling throughput. I understand they are doing some "prioritizing" of packets. Does anybody know how Lasso pages are identified? In other words, do they just look like standard http packets on port 80? Cox is supposedly making those a higher priority but these particularly time-consuming pages simply do not work when being sent outside my network. > >Scott Brister -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
| Free embeddable forum powered by Nabble | Forum Help |