php-general Digest 5 May 2010 16:55:13 -0000 Issue 6728
php-general Digest 5 May 2010 16:55:13 - Issue 6728 Topics (messages 304896 through 304907): Re: Inserting rows with missing IDs 304896 by: Nathan Rixham 304904 by: tedd how to check for bandwidth limitations when uploading files? 304897 by: Robert P. J. Day 304898 by: Jochen Schultz 304899 by: Tommy Pham 304900 by: Robert P. J. Day 304905 by: tedd strtotime woes 304901 by: Philip Thompson 304902 by: Peter Lind 304906 by: Philip Thompson Re: In need of CVS/SVN checkout script for Production servers [solved] 304903 by: tedd Can't find my error 304907 by: David McGlone Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Richard Quadling wrote: On 3 May 2010 14:34, Andre Polykanine an...@oire.org wrote: Hello everyone, It's not a strictly PHP question, however since I use that with PHP, I'm asking it there. How can I accomplish the task of inserting rows into MySql database with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and 195. How do I make the check that allows to insert firstly the missing IDs and only then apply the auto-increment? Thanks! You can also reseed the autoinc column back to 0 and that will start filling in the gaps. ALTER TABLE tablename AUTO_INCREMENT = 0 may work for you (http://arstechnica.com/civis/viewtopic.php?f=20t=123689 via http://tinyurl.com/3amlo2u) quite sure that once mysql hit's the max int limit it starts filling in the gaps too - like ~96.4% sure have to agree though, one shouldn't have any dependency on sequential numbers (unless it's a number table!) best, nathan ---End Message--- ---BeginMessage--- Richard Quadling wrote: On 3 May 2010 14:34, Andre Polykanine an...@oire.org wrote: Hello everyone, It's not a strictly PHP question, however since I use that with PHP, I'm asking it there. How can I accomplish the task of inserting rows into MySql database with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and 195. How do I make the check that allows to insert firstly the missing IDs and only then apply the auto-increment? Thanks! You can also reseed the autoinc column back to 0 and that will start filling in the gaps. ALTER TABLE tablename AUTO_INCREMENT = 0 may work for you (http://arstechnica.com/civis/viewtopic.php?f=20t=123689 via http://tinyurl.com/3amlo2u) quite sure that once mysql hit's the max int limit it starts filling in the gaps too - like ~96.4% sure have to agree though, one shouldn't have any dependency on sequential numbers (unless it's a number table!) best, nathan And if they really want just a sequential number ID that they DO NOT depend upon, they can always drop the id from the table and then recreated it -- that way it will be automatically renumbered. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? rday ---End Message--- ---BeginMessage--- OS? Robert P. J. Day schrieb: probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5
[PHP] how to check for bandwidth limitations when uploading files?
probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? rday -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to check for bandwidth limitations when uploading files?
OS? Robert P. J. Day schrieb: probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? rday -- Sport Import GmbH - Amtsgericht Oldenburg - Tel: +49-4405-9280-63 Industriestrasse 39 - HRB 1202900- 26188 Edewecht - GF: Michael Müllmann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how to check for bandwidth limitations when uploading files?
-Original Message- From: Robert P. J. Day [mailto:rpj...@crashcourse.ca] Sent: Wednesday, May 05, 2010 3:52 AM To: php-general@lists.php.net Subject: [PHP] how to check for bandwidth limitations when uploading files? probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? rday IIRC, if you're on *BSD and have PF running, you can get the bandwidth of each individual connection via pftop (?). On Windows, there are several tools that will give similar results. Don't know about Linux. OTOH, maybe your script isn't timed correctly? Is the tested loop done on the localhost or from another remote host establishing the connection via the internet? FYI, if you're hosting it yourself and have async connection like DSL or cable, the upload to your server is the download connection speed which should be faster than your upload (from the server) to the clients. And a 5MB file shouldn't take long provided that your server hasn't reached its resources limits and the internet pipe isn't consumed by other services or systems on the LAN. Regards, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to check for bandwidth limitations when uploading files?
Quoting Jochen Schultz jschu...@sportimport.de: OS? Robert P. J. Day schrieb: probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? whoops, sorry, CentOS 5.4. rday -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strtotime woes
Hello all. Long time no see! Anyway, I'm having an issue with strtotime(). Why do the following return valid timestamps? ?php echo strtotime ('a').': '.date (m/d/Y, strtotime ('a')).br/; echo strtotime ('a,a').': '.date (m/d/Y, strtotime ('a,a')).br/; echo strtotime ('a,a,a').': '.date (m/d/Y, strtotime ('a,a,a')).br/; ? These result in today's date: 1273049449: 05/05/2010 1273049449: 05/05/2010 1273049449: 05/05/2010 Each time the page is reloaded, the seconds jump up... but still today's date. Why is this? I can repeat the same results by changing the 'a' to any other single letter: g or h,k or r,s,t or whatever - all the same result. Thanks, ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strtotime woes
On 5 May 2010 16:58, Philip Thompson philthath...@gmail.com wrote: Hello all. Long time no see! Anyway, I'm having an issue with strtotime(). Why do the following return valid timestamps? ?php echo strtotime ('a').': '.date (m/d/Y, strtotime ('a')).br/; echo strtotime ('a,a').': '.date (m/d/Y, strtotime ('a,a')).br/; echo strtotime ('a,a,a').': '.date (m/d/Y, strtotime ('a,a,a')).br/; ? These result in today's date: 1273049449: 05/05/2010 1273049449: 05/05/2010 1273049449: 05/05/2010 Each time the page is reloaded, the seconds jump up... but still today's date. Why is this? I can repeat the same results by changing the 'a' to any other single letter: g or h,k or r,s,t or whatever - all the same result. This was discusses a little while ago, have a look at news.php.net/php.general/303839/Logical-reason-for-strtotime-east-and-strtotime-west-returningvalid-results.html and the responses. Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] In need of CVS/SVN checkout script for Production servers [solved]
At 1:10 PM -0700 5/4/10, Daevid Vincent wrote: Well, here is the one I'm using. I ended up just writing one (again!) http://www.daevid.com/content/examples/snippets.php :: Production Deployment Script What?!? Advanced features?? I know you don't mean it, but you certainly know how to piss people off. You are not going to like what I have to say, but please accept the following as constructive criticism with no personal intent meant. The site fails W3C CSS validation with 96 errors. The site fails W3C HTML validation with 92 errors and 9 warnings. I have not run into a site like this since before the turn of this century where we had browser wars. The problem isn't just with my browser, but many more as you can see here: http://www.browsercam.com/public.aspx?proj_id=516739 The page (not addressing the entire site) is riddled with embedded javascript and embedded styling both of which are considered bad from. I haven't even addressed accessibility, graceful degradation, or separation of content from presentation from behavior all of which are the goals of best practices sites -- and all of which this site fails miserably. My advice, which I realize that you didn't ask for, is if you want to provide something of substance, then do so for all and not just the privileged elite who think they are the leading edge with this type of gimmick nonsense. This site is a step backward into the old browser wars. Of course, I could tell you what I really think, but I don't want to be too abrasive. :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inserting rows with missing IDs
Richard Quadling wrote: On 3 May 2010 14:34, Andre Polykanine an...@oire.org wrote: Hello everyone, It's not a strictly PHP question, however since I use that with PHP, I'm asking it there. How can I accomplish the task of inserting rows into MySql database with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and 195. How do I make the check that allows to insert firstly the missing IDs and only then apply the auto-increment? Thanks! You can also reseed the autoinc column back to 0 and that will start filling in the gaps. ALTER TABLE tablename AUTO_INCREMENT = 0 may work for you (http://arstechnica.com/civis/viewtopic.php?f=20t=123689 via http://tinyurl.com/3amlo2u) quite sure that once mysql hit's the max int limit it starts filling in the gaps too - like ~96.4% sure have to agree though, one shouldn't have any dependency on sequential numbers (unless it's a number table!) best, nathan And if they really want just a sequential number ID that they DO NOT depend upon, they can always drop the id from the table and then recreated it -- that way it will be automatically renumbered. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to check for bandwidth limitations when uploading files?
At 6:52 AM -0400 5/5/10, Robert P. J. Day wrote: probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? rday You might want to test your connection, such as: http://www.speakeasy.net/speedtest/ Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strtotime woes
On May 5, 2010, at 10:12 AM, Peter Lind wrote: On 5 May 2010 16:58, Philip Thompson philthath...@gmail.com wrote: Hello all. Long time no see! Anyway, I'm having an issue with strtotime(). Why do the following return valid timestamps? ?php echo strtotime ('a').': '.date (m/d/Y, strtotime ('a')).br/; echo strtotime ('a,a').': '.date (m/d/Y, strtotime ('a,a')).br/; echo strtotime ('a,a,a').': '.date (m/d/Y, strtotime ('a,a,a')).br/; ? These result in today's date: 1273049449: 05/05/2010 1273049449: 05/05/2010 1273049449: 05/05/2010 Each time the page is reloaded, the seconds jump up... but still today's date. Why is this? I can repeat the same results by changing the 'a' to any other single letter: g or h,k or r,s,t or whatever - all the same result. This was discusses a little while ago, have a look at news.php.net/php.general/303839/Logical-reason-for-strtotime-east-and-strtotime-west-returningvalid-results.html and the responses. Regards Peter Thanks for the link. I did a little bit more research and found a site that may help explain what is happening. http://wwp.greenwichmeantime.com/info/timezone.htm In the column labeled Zone are all the letters of the alphabet (except J). So, then I thought to print the times with the date() functions above - they were various time(zones). Basically, I think strotime() is just ignoring the characters after the first comma in the values above, so then it was finding valid timezones. Odd. Hope this helps someone in the future Thanks, ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't find my error
I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: Parse error: syntax error, unexpected T_VARIABLE in /home/david/www/Joe/current/presentation/smarty_plugins/function.load_products_list.php on line 27. Can anyone spot my error? I'd appreciate the help. Here is the function.load_products_list.php file: 1. ?php 2. function smarty_function_load_products_list($params, $smarty) 3. { 4. $products_list = new $ProductsList(); 5. $products_list-init(); 6. 7. //assign the template variable 8. $smarty-assign($params['assign'], $products_list); 9. } 10. 11. //Manage the products list 12. class ProductsList 13. { 14. public $mProducts; 15. public $mSelectedProduct; 16. 17. private $mBoCatalog; 18. 19. //constructor initializes business tier object 20. //and reads query string parameter 21. function __construct() 22. { 23. //creating the middle tier object 24. $this-mBoCatalog = new BoCatalog(); 25. //if ProductID exists in the query string, we're viewing a product. 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; 28. else 29. $this-mSelectedProduct = -1; 30 } 31. 32. //calls business tier to read products list and create the links 33. function init() 34. { 35. //get list of products from business tier 36. $this-mProducts = $this-mBoCatalog-GetProducts(); 37. //create the product links 38. for($i = 0; $i count($this-mProducts); $i++) 39. $this-mProducts[$i]['onclick'] = index.php?ProductID= . 40. $this-mProducts[$i]['product_id']; 41. } 42. } 43. ? Just in case Im going to include the template file: {*products_list.tpl*} {load_products_list assign=products_list} {*start products_list*} pProducts/p {*loop through the list of products*} {section name=i loop=$products_list-mProducts} {if ($products_list-mSelectedProduct == $products_list-mProducts[i].product_id)} {assign var=class_d value=ProductSelected} {else} {assign var=class_d value=ProductUnselected} {/if} {*generate a link for a new product in the list*} a href={$products_list-mProducts[i].onclick} $raquo; {$products_list-mProducts[i].make}/a {/section} -- Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't find my error
On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote: I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: Parse error: syntax error, unexpected T_VARIABLE in /home/david/www/Joe/current/presentation/smarty_plugins/function.load_products_list.php on line 27. Can anyone spot my error? I'd appreciate the help. Here is the function.load_products_list.php file: 1. ?php 2. function smarty_function_load_products_list($params, $smarty) 3. { 4.$products_list = new $ProductsList(); 5.$products_list-init(); 6. 7.//assign the template variable 8.$smarty-assign($params['assign'], $products_list); 9. } 10. 11. //Manage the products list 12. class ProductsList 13. { 14. public $mProducts; 15. public $mSelectedProduct; 16. 17. private $mBoCatalog; 18. 19. //constructor initializes business tier object 20. //and reads query string parameter 21. function __construct() 22. { 23. //creating the middle tier object 24. $this-mBoCatalog = new BoCatalog(); 25. //if ProductID exists in the query string, we're viewing a product. 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; 28. else 29. $this-mSelectedProduct = -1; 30} 31. 32. //calls business tier to read products list and create the links 33. function init() 34. { 35. //get list of products from business tier 36. $this-mProducts = $this-mBoCatalog-GetProducts(); 37. //create the product links 38. for($i = 0; $i count($this-mProducts); $i++) 39. $this-mProducts[$i]['onclick'] = index.php?ProductID= . 40. $this-mProducts[$i]['product_id']; 41. } 42. } 43. ? Just in case Im going to include the template file: {*products_list.tpl*} {load_products_list assign=products_list} {*start products_list*} pProducts/p {*loop through the list of products*} {section name=i loop=$products_list-mProducts} {if ($products_list-mSelectedProduct == $products_list-mProducts[i].product_id)} {assign var=class_d value=ProductSelected} {else} {assign var=class_d value=ProductUnselected} {/if} {*generate a link for a new product in the list*} a href={$products_list-mProducts[i].onclick} $raquo; {$products_list-mProducts[i].make}/a {/section} -- Blessings, David M. Line 27 is this: $this-mSelectedProduct = (init)$_GET['ProductID']; Shouldn't it be (int) not (init)? Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Can't find my error
On Wed, May 5, 2010 at 12:55 PM, David McGlone da...@dmcentral.net wrote: 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; You've got (init) instead of (int). Its always those little characters causing trouble! -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry
Re: [PHP] Can't find my error
On 5 May 2010 18:55, David McGlone da...@dmcentral.net wrote: I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: Parse error: syntax error, unexpected T_VARIABLE in /home/david/www/Joe/current/presentation/smarty_plugins/function.load_products_list.php on line 27. Can anyone spot my error? I'd appreciate the help. Here is the function.load_products_list.php file: 1. ?php 2. function smarty_function_load_products_list($params, $smarty) 3. { 4. $products_list = new $ProductsList(); 5. $products_list-init(); 6. 7. //assign the template variable 8. $smarty-assign($params['assign'], $products_list); 9. } 10. 11. //Manage the products list 12. class ProductsList 13. { 14. public $mProducts; 15. public $mSelectedProduct; 16. 17. private $mBoCatalog; 18. 19. //constructor initializes business tier object 20. //and reads query string parameter 21. function __construct() 22. { 23. //creating the middle tier object 24. $this-mBoCatalog = new BoCatalog(); 25. //if ProductID exists in the query string, we're viewing a product. 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; pretty sure (init) is not a valid cast ... Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Inconsistent json_decode() results
Hello all! We're seeing inconsistent json decoding between PHP versions: http://gist.github.com/390090 Calling json_decode() from 5.2.6 returns an associative array when asked, while 5.2.10 always returns a stdClass. Is this a bug or a problem with my calling convention? Thanks! François
Re: [PHP] Can't find my error
On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote: On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote: I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: Parse error: syntax error, unexpected T_VARIABLE in /home/david/www/Joe/current/presentation/smarty_plugins/function.load_pro ducts_list.php on line 27. Can anyone spot my error? I'd appreciate the help. Here is the function.load_products_list.php file: 1. ?php 2. function smarty_function_load_products_list($params, $smarty) 3. { 4. $products_list = new $ProductsList(); 5. $products_list-init(); 6. 7. //assign the template variable 8. $smarty-assign($params['assign'], $products_list); 9. } 10. 11. //Manage the products list 12. class ProductsList 13. { 14. public $mProducts; 15. public $mSelectedProduct; 16. 17. private $mBoCatalog; 18. 19. //constructor initializes business tier object 20. //and reads query string parameter 21. function __construct() 22. { 23. //creating the middle tier object 24. $this-mBoCatalog = new BoCatalog(); 25. //if ProductID exists in the query string, we're viewing a product. 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; 28. else 29. $this-mSelectedProduct = -1; 30 } 31. 32. //calls business tier to read products list and create the links 33. function init() 34. { 35. //get list of products from business tier 36. $this-mProducts = $this-mBoCatalog-GetProducts(); 37. //create the product links 38. for($i = 0; $i count($this-mProducts); $i++) 39. $this-mProducts[$i]['onclick'] = index.php?ProductID= . 40. $this-mProducts[$i]['product_id']; 41. } 42. } 43. ? Just in case Im going to include the template file: {*products_list.tpl*} {load_products_list assign=products_list} {*start products_list*} pProducts/p {*loop through the list of products*} {section name=i loop=$products_list-mProducts} {if ($products_list-mSelectedProduct == $products_list-mProducts[i].product_id)} {assign var=class_d value=ProductSelected} {else} {assign var=class_d value=ProductUnselected} {/if} {*generate a link for a new product in the list*} a href={$products_list-mProducts[i].onclick} $raquo; {$products_list-mProducts[i].make}/a {/section} -- Blessings, David M. Line 27 is this: $this-mSelectedProduct = (init)$_GET['ProductID']; Shouldn't it be (int) not (init)? Thanks, Ash http://www.ashleysheridan.co.uk WOW I have spent at least 4 hours reading and re-reading it and it took you 3 seconds. That was the problem. How, how, how could I have overlooked that so many times Thank you Ashley, I should have asked you 3 hours ago. ;-) -- Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't find my error
On Wednesday 05 May 2010 12:59:00 Peter Lind wrote: On 5 May 2010 18:55, David McGlone da...@dmcentral.net wrote: I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: Parse error: syntax error, unexpected T_VARIABLE in /home/david/www/Joe/current/presentation/smarty_plugins/function.load_pro ducts_list.php on line 27. Can anyone spot my error? I'd appreciate the help. Here is the function.load_products_list.php file: 1. ?php 2. function smarty_function_load_products_list($params, $smarty) 3. { 4. $products_list = new $ProductsList(); 5. $products_list-init(); 6. 7. //assign the template variable 8. $smarty-assign($params['assign'], $products_list); 9. } 10. 11. //Manage the products list 12. class ProductsList 13. { 14. public $mProducts; 15. public $mSelectedProduct; 16. 17. private $mBoCatalog; 18. 19. //constructor initializes business tier object 20. //and reads query string parameter 21. function __construct() 22. { 23. //creating the middle tier object 24. $this-mBoCatalog = new BoCatalog(); 25. //if ProductID exists in the query string, we're viewing a product. 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; pretty sure (init) is not a valid cast ... Your hunch is correct. LOL Still can't believe I overlooked that so many times. -- Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't find my error
On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: On Wed, May 5, 2010 at 12:55 PM, David McGlone da...@dmcentral.net wrote: 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; You've got (init) instead of (int). Its always those little characters causing trouble! Tell me about it. I kept telling myself for the last 4 hours I can find it, I can find it I don't need to ask the list Huh! I was wrong! -- Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't find my error
On Wed, May 5, 2010 at 1:06 PM, David McGlone da...@dmcentral.net wrote: On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: On Wed, May 5, 2010 at 12:55 PM, David McGlone da...@dmcentral.net wrote: 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; You've got (init) instead of (int). Its always those little characters causing trouble! Tell me about it. I kept telling myself for the last 4 hours I can find it, I can find it I don't need to ask the list Huh! I was wrong! LOL sometimes a second set of eyes is required. We've all been in your shoes! -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry
Re: [PHP] Inconsistent json_decode() results
Hi I have this problem too. I think that the version of php results this problem. I have searched later but could not find any solution. 2010/5/5 François Beausoleil franc...@teksol.info: Hello all! We're seeing inconsistent json decoding between PHP versions: http://gist.github.com/390090 Calling json_decode() from 5.2.6 returns an associative array when asked, while 5.2.10 always returns a stdClass. Is this a bug or a problem with my calling convention? Thanks! François -- Ali Asghar Torabi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to check for bandwidth limitations when uploading files?
Robert P. J. Day wrote: probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? rday What web server are you using? Is it Apache, lighttpd, php daemon, etc? If it is anything but directly talking to a php daemon, you must take into consideration that the parent web server does not hand off processing to PHP until it has received the entire file. At this point is when your timer script starts working. So, what is receiving the file? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inconsistent json_decode() results
2010/5/5 Ali Asghar Toraby Parizy aliasghar.tor...@gmail.com 2010/5/5 François Beausoleil franc...@teksol.info: Hello all! We're seeing inconsistent json decoding between PHP versions: http://gist.github.com/390090 Calling json_decode() from 5.2.6 returns an associative array when asked, while 5.2.10 always returns a stdClass. Is this a bug or a problem with my calling convention? Thanks! François I think this is a bug, since you're using it correctly. 5.2.11 seems to have fixed the problem: http://pastie.org/947103 Michiel ps to Ali, most people here seem to prefer it if you type your reply at the bottom of the previous post. I personally don't mind since my client (Gmail) hides quoted text by default, but it does make things easier if you can see the quoted text.
Re: [PHP] Inconsistent json_decode() results
2010/5/5 François Beausoleil franc...@teksol.info Hello all! We're seeing inconsistent json decoding between PHP versions: http://gist.github.com/390090 Calling json_decode() from 5.2.6 returns an associative array when asked, while 5.2.10 always returns a stdClass. Is this a bug or a problem with my calling convention? Thanks! François By the way, if you're stuck on 5.2.10, you could simply cast the result to array: var_dump((array)json_decode('{_urls: [a, b]}')); Michiel
Re: [PHP] Two color rows in table inside while iteration -- just say no to mod
On 3 May 2010 08:25, Jochen Schultz jschu...@sportimport.de wrote: [snip] And unless we are adding a multiple seconds to the load time is anyone going to notice a difference of 1 second? yes It's really not that big a deal. http://pastie.org/947121 Personally, I think using modulus is as nice a solution as flipping a bit. Maybe more elegant since it's extendable to more than 2 states if required. Michiel
Re: [PHP] Inconsistent json_decode() results
2010/5/5 Michiel Sikma mich...@thingmajig.org: By the way, if you're stuck on 5.2.10, you could simply cast the result to array: var_dump((array)json_decode('{_urls: [a, b]}')); I don't see a available starting in 5.x.x notice, so I think it's been there for a long time... http://www.php.net/json_decode Second parameter of true makes it return an array instead of a class (I just had to use this recently, that's why it popped in my mind) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inconsistent json_decode() results
On 5 May 2010 20:02, Michael Shadle mike...@gmail.com wrote: 2010/5/5 Michiel Sikma mich...@thingmajig.org: By the way, if you're stuck on 5.2.10, you could simply cast the result to array: var_dump((array)json_decode('{_urls: [a, b]}')); I don't see a available starting in 5.x.x notice, so I think it's been there for a long time... http://www.php.net/json_decode You're right, but this is about how 5.2.10 ignores the second parameter and always returns a class, which appears to be a bug. I'm not sure which other versions have this same problem, but 5.2.11 has correct behavior, which seems to suggest they found and fixed it by then. I can't find an entry for this problem in PHP's bug database, however. My suggestion to typecast the result of json_decode() should only be followed if you need an array and are required to work with version 5.2.10. Michiel
Re: [PHP] Inconsistent json_decode() results
On Wed, May 5, 2010 at 1:11 PM, Michiel Sikma mich...@thingmajig.org wrote: You're right, but this is about how 5.2.10 ignores the second parameter and always returns a class, which appears to be a bug. I'm not sure which other versions have this same problem, but 5.2.11 has correct behavior, which seems to suggest they found and fixed it by then. I can't find an entry for this problem in PHP's bug database, however. My suggestion to typecast the result of json_decode() should only be followed if you need an array and are required to work with version 5.2.10. A. I gotcha now. Yeah I started using that just recently either 5.2.11 or 5.2.13 (not sure which) You can typecast an object to an array that easily? I was unaware. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't find my error
On Wed, May 05, 2010 at 01:03:41PM -0400, David McGlone wrote: On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote: On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote: I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: snip WOW I have spent at least 4 hours reading and re-reading it and it took you 3 seconds. That was the problem. How, how, how could I have overlooked that so many times Thank you Ashley, I should have asked you 3 hours ago. ;-) Yeah, David, the rest of us are really disappointed in you. I mean, it's not like that's ever happened to *us*. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inconsistent json_decode() results
On 5 May 2010 22:14, Michael Shadle mike...@gmail.com wrote: -snip- A. I gotcha now. Yeah I started using that just recently either 5.2.11 or 5.2.13 (not sure which) You can typecast an object to an array that easily? I was unaware. Yep, it's that easy. :-) // array(1) { // [0]= // int(1) // } var_dump((array)1); // array(1) { // [0]= // string(1) a // } var_dump((array)'a'); // array(1) { // [c]= // string(1) d // } class b { public $c = 'd'; } var_dump((array)new b()); Michiel
Re: [PHP] In need of CVS/SVN checkout script for Production servers [solved]
On 5 May 2010 17:18, tedd tedd.sperl...@gmail.com wrote: At 1:10 PM -0700 5/4/10, Daevid Vincent wrote: Well, here is the one I'm using. I ended up just writing one (again!) http://www.daevid.com/content/examples/snippets.php :: Production Deployment Script What?!? Advanced features?? -snip- Just want to add my +1 to this. I'm running Safari, which most definitely will support whatever advanced features you put in there, and I'm being blocked. Putting aside the level of standards compliance of your site, you really should blacklist browsers instead of whitelisting them. Sites should never become inaccessible if your browser lacks features, and even if the entire site revolves around some fancy Javascript, you should at least provide a go ahead at your own risk link in case you're accidentally shutting out the wrong browser. Here's an example from a site I made a while ago which mimics the workings of Gmail. It's accessible to screen readers through alternative content, and if you're trying to visit using IE6 (we consciously decided not to apply browser fixes for it), you get the following message: http://wedemandhtml.com/tmp/tag_ie6_is_unsupported.png Michiel
[PHP] Really impressive work
Hi gang: I found something that really impressed me -- please review this: http://palomarjewelry.com/product/id/19/collectionId/1/typeId/3 Try changing the number and type of stones and watch the main image change (i.e., the basket). If one calculates the number of permutations required to show this single piece of jewelry with 12 different stone types located in 15 different stone positions, you will arrive at a very large number. The specific math escapes me at the moment but something in the order of 15 factorial -- a very large number. Now, I realize that this company did not take 15 factorial pictures of this single piece of jewelry to present all these different combinations but instead placed smaller images of each of the stones at specific coordinates on the larger image of the jewelry. I imagine that each piece of jewelry must have the coordinates of each setting in a database so that they can on-the-fly assemble the finished product as per user's direction. For example, let's take the image of the basket pendant showing three stones. Each of the stone locations would have a specific pixel placement (i.e., x,y). As such, the database would have a field for the image and three location fields for stones 1, 2, and 3. Now, we also have smaller images of 12 different stones (in heads) that are all the same size. Thus, as the user picks the stones and positions they want and the image is assembled on the fly. Is that the way you see this? Or is there a better way? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Two color rows in table inside while iteration [X-PHP]
On 2 May 2010 19:11, tedd tedd.sperl...@gmail.com wrote: government rant -snip- Yes, it would be nice if the people who work for the government also had to live under the same rules as the rest of us. As it is, they live in a state of privilege enjoying salaries that are typically 175 percent above that of the private sector with benefits to match. They do this without advancing the quality of life for anyone -- they have no purpose other than to push papers, collect *their* wages, enjoy *their* health insurance, and wait for *their* lavish retirement. Of course, they claim they have purpose, but most of us know better. The sooner we reduce the size and importance of government, the better off we all will be. /government rant Cheers, tedd Hello, I'm not a moderator of this list, but I would like to ask you to please not use the PHP list for such confronting political diatribes. This is a very well known talking point that can easily elicit a lengthy off-topic discussion, and I don't think anybody is really interested in that. Again, this is just my opinion, but while it's okay to talk about things other than PHP on occasion, I don't really see what use this has other than provoking a response from someone. Please be considerate is all I'm asking. Michiel
Re: [PHP] Really impressive work
On 6 May 2010 00:04, tedd t...@sperling.com wrote: Hi gang: I found something that really impressed me -- please review this: -snip- Now, we also have smaller images of 12 different stones (in heads) that are all the same size. Thus, as the user picks the stones and positions they want and the image is assembled on the fly. Is that the way you see this? Or is there a better way? Cheers, tedd Personally, I wouldn't bother building an image generator (which isn't that difficult to do with GD or Imagick--and I wouldn't go as far as to save the values in a database). This can easily be done in Javascript. The only reason to build an image generator is if the images need to be used in a non-browser environment, e.g. sent to the user in an e-mail or enclosed in a PDF. At minimum you need all colorized images of the jewels, but you could even do with one single image and colorize it using canvas. Too bad that's not supported in anything other than (iirc) Firefox and the Webkit nightly. Michiel
[PHP] Re: Really impressive work
tedd wrote: Hi gang: I found something that really impressed me -- please review this: http://palomarjewelry.com/product/id/19/collectionId/1/typeId/3 Try changing the number and type of stones and watch the main image change (i.e., the basket). If one calculates the number of permutations required to show this single piece of jewelry with 12 different stone types located in 15 different stone positions, you will arrive at a very large number. The specific math escapes me at the moment but something in the order of 15 factorial -- a very large number. Now, I realize that this company did not take 15 factorial pictures of this single piece of jewelry to present all these different combinations but instead placed smaller images of each of the stones at specific coordinates on the larger image of the jewelry. I imagine that each piece of jewelry must have the coordinates of each setting in a database so that they can on-the-fly assemble the finished product as per user's direction. For example, let's take the image of the basket pendant showing three stones. Each of the stone locations would have a specific pixel placement (i.e., x,y). As such, the database would have a field for the image and three location fields for stones 1, 2, and 3. Now, we also have smaller images of 12 different stones (in heads) that are all the same size. Thus, as the user picks the stones and positions they want and the image is assembled on the fly. Is that the way you see this? Or is there a better way? Better way, no. Alternative ways, yes. SVG Canvas + JS HTML4 + CSS + JS (optional transparent pngs) Flash Any number of java plugins (although perhaps overkill). Personally though, I'd go for SVG or the way it is currently implemented with server side gd or suchlike. The reason for saying this is to ensure that the results were identical on as many platforms as possible - the one addition I would make would be an update image button which displayed on noscript, which resubmitted the page / form and showed the image - for those without (or with non compliant) js implementations. I tend to agree that it's impressive, personally I don't think the code behind it rocket science; however the idea to peice what is essentially how many numbers do you want, what are those numbers together in such a user pleasing and useful way, is definately something to applaud :) Best, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to check for bandwidth limitations when uploading files?
Jim Lucas wrote: Robert P. J. Day wrote: probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? rday What web server are you using? Is it Apache, lighttpd, php daemon, etc? If it is anything but directly talking to a php daemon, you must take into consideration that the parent web server does not hand off processing to PHP until it has received the entire file. At this point is when your timer script starts working. So, what is receiving the file? I'd call the script via ab [1] from localhost, the computer you're testing and then another server with a good connection - that way you'll get solid numbers and be able to pinpoint the bottleneck in a snap. [1] http://httpd.apache.org/docs/2.0/programs/ab.html Best, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] In need of CVS/SVN checkout script for Production servers [solved]
-Original Message- From: tedd [mailto:tedd.sperl...@gmail.com] Sent: Wednesday, May 05, 2010 8:19 AM To: Daevid Vincent; php-general@lists.php.net Subject: RE: [PHP] In need of CVS/SVN checkout script for Production servers [solved] At 1:10 PM -0700 5/4/10, Daevid Vincent wrote: Well, here is the one I'm using. I ended up just writing one (again!) http://www.daevid.com/content/examples/snippets.php :: Production Deployment Script What?!? Advanced features?? I know you don't mean it, but you certainly know how to piss people off. You are not going to like what I have to say, but please accept the following as constructive criticism with no personal intent meant. The site fails W3C CSS validation with 96 errors. The site fails W3C HTML validation with 92 errors and 9 warnings. I have not run into a site like this since before the turn of this century where we had browser wars. The problem isn't just with my browser, but many more as you can see here: http://www.browsercam.com/public.aspx?proj_id=516739 The page (not addressing the entire site) is riddled with embedded javascript and embedded styling both of which are considered bad from. I haven't even addressed accessibility, graceful degradation, or separation of content from presentation from behavior all of which are the goals of best practices sites -- and all of which this site fails miserably. My advice, which I realize that you didn't ask for, is if you want to provide something of substance, then do so for all and not just the privileged elite who think they are the leading edge with this type of gimmick nonsense. This site is a step backward into the old browser wars. Of course, I could tell you what I really think, but I don't want to be too abrasive. :-) Cheers, tedd *sigh* once again you people focus on something S off topic compared to the meat of the thread -- which is a production repository checkout script. As for my site. [*] I wrote it like 4 years ago or more when there were TWO browsers worth mentioning: IE and FF. [*] I used a 3rd party JS library from www.ceiton.com -- who are pretty much dormant. [*] The cieton code is not only compressed and impossible to debug, but often written in German! [*] I've looked at it a few times over the years to try and remove the limitation, because I also agree that most modern browsers should be able to handle the JS at this point. [*] I really don't care about the fringe browsers of Chrome, Opera, Konquerer, Blackberry, whatever (for my PERSONAL HOME PAGE) [*] http://www.w3schools.com/browsers/browsers_stats.asp [*] http://marketshare.hitslink.com/report.aspx?qprid=0 [*] I'm sorry your using a browser that falls under the top 25%. In fact ALL the browsers besides IE and FF don't even add up to 16% of the ENTIRE market. Give me a break man. I've got more important things to do. [*] If you don't have Firefox, well then let me tell you where to go download it for free: http://www.mozilla.com They make it for all major OS's in case you didn't know. [*] Honestly, I also dislike Apple. I think it's stupid for them to make a browser. I think they make crappy products. I HATE my iPod. I am a Linux guy (or was until I realized my time was too valuable to keep wasting on Linux as a Desktop), and WANTED to LOVE OSX. I sold the damn notebook after a month of owning it. OSX blows. It's too dumbed down IMHO (as is Windows7, but that's another topic). In light of recent events where they fired a guy for showing that even more stupid iPad (great, a big iPhone that can't even call) to Wozniak and then going after Gizmodo, I have even more distain for them. So I really have no care to support them in any way shape or form. If the site works for Safari, fine. If not, oh well, change your USER_AGENT string or get Firefox/IE. As for CSS, inline styles, separation of logic, and all that other stuff you ASSUME I don't use -- you are very wrong. I just happen to use a lot of PHP to dynamically create various parts. In some cases I inline styles where they are used one time or used in a PHP function. I freely admit that there is some archaic code there too. Code that I'm not about to go back and re-factor at this stage. I know much more now than I did then. I would certainly do things differently, and the next time I get a wild-hair up my ass and a few days of that elusive commodity known as free time to code up a new design I will. Again, this is my personal site that's only purpose is to show some pictures and other random shit. And with all due respect Tedd -- as I know you're an icon here and I've learned many things from you myself. If I had to choose between my daevid.com site and one of the three you (presumably) illustrate as beacons of the way to do it (http://sperling.com http://ancientstones.com http://earthstones.com), then I would take my site any day of the week. These three sites
Re: [PHP] Can't find my error
On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote: On Wed, May 5, 2010 at 1:06 PM, David McGlone da...@dmcentral.net wrote: On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: On Wed, May 5, 2010 at 12:55 PM, David McGlone da...@dmcentral.net wrote: 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init)$_GET['ProductID']; You've got (init) instead of (int). Its always those little characters causing trouble! Tell me about it. I kept telling myself for the last 4 hours I can find it, I can find it I don't need to ask the list Huh! I was wrong! LOL sometimes a second set of eyes is required. We've all been in your shoes! True. I need to learn to ask for help, but I don't want to fall into the habit of taking it for granted. I'm still learning so I need to try my hardest before I go getting an answer. -- Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't find my error
On Wednesday 05 May 2010 16:19:35 Paul M Foster wrote: On Wed, May 05, 2010 at 01:03:41PM -0400, David McGlone wrote: On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote: On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote: I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: snip WOW I have spent at least 4 hours reading and re-reading it and it took you 3 seconds. That was the problem. How, how, how could I have overlooked that so many times Thank you Ashley, I should have asked you 3 hours ago. ;-) Yeah, David, the rest of us are really disappointed in you. I mean, it's not like that's ever happened to *us*. ;-} I've been studying PHP for at least 2 years straight now, after dabbling in it for about a year 6 years ago. So even though I've had my nose to the grind for a good 2 years now, I don't think I can call my mistake a rookie mistake. Thats what's frustrating to me. LOL -- Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] In need of CVS/SVN checkout script for Production servers [solved]
Daevid Vincent wrote: -Original Message- From: tedd [mailto:tedd.sperl...@gmail.com] Sent: Wednesday, May 05, 2010 8:19 AM To: Daevid Vincent; php-general@lists.php.net Subject: RE: [PHP] In need of CVS/SVN checkout script for Production servers [solved] At 1:10 PM -0700 5/4/10, Daevid Vincent wrote: Well, here is the one I'm using. I ended up just writing one (again!) http://www.daevid.com/content/examples/snippets.php :: Production Deployment Script What?!? Advanced features?? I know you don't mean it, but you certainly know how to piss people off. You are not going to like what I have to say, but please accept the following as constructive criticism with no personal intent meant. The site fails W3C CSS validation with 96 errors. The site fails W3C HTML validation with 92 errors and 9 warnings. I have not run into a site like this since before the turn of this century where we had browser wars. The problem isn't just with my browser, but many more as you can see here: http://www.browsercam.com/public.aspx?proj_id=516739 The page (not addressing the entire site) is riddled with embedded javascript and embedded styling both of which are considered bad from. I haven't even addressed accessibility, graceful degradation, or separation of content from presentation from behavior all of which are the goals of best practices sites -- and all of which this site fails miserably. My advice, which I realize that you didn't ask for, is if you want to provide something of substance, then do so for all and not just the privileged elite who think they are the leading edge with this type of gimmick nonsense. This site is a step backward into the old browser wars. Of course, I could tell you what I really think, but I don't want to be too abrasive. :-) Cheers, tedd *sigh* once again you people focus on something S off topic compared to the meat of the thread -- which is a production repository checkout script. As for my site. [*] I wrote it like 4 years ago or more when there were TWO browsers worth mentioning: IE and FF. [*] I used a 3rd party JS library from www.ceiton.com -- who are pretty much dormant. [*] The cieton code is not only compressed and impossible to debug, but often written in German! [*] I've looked at it a few times over the years to try and remove the limitation, because I also agree that most modern browsers should be able to handle the JS at this point. [*] I really don't care about the fringe browsers of Chrome, Opera, Konquerer, Blackberry, whatever (for my PERSONAL HOME PAGE) [*] http://www.w3schools.com/browsers/browsers_stats.asp [*] http://marketshare.hitslink.com/report.aspx?qprid=0 [*] I'm sorry your using a browser that falls under the top 25%. In fact ALL the browsers besides IE and FF don't even add up to 16% of the ENTIRE market. Give me a break man. I've got more important things to do. [*] If you don't have Firefox, well then let me tell you where to go download it for free: http://www.mozilla.com They make it for all major OS's in case you didn't know. [*] Honestly, I also dislike Apple. I think it's stupid for them to make a browser. I think they make crappy products. I HATE my iPod. I am a Linux guy (or was until I realized my time was too valuable to keep wasting on Linux as a Desktop), and WANTED to LOVE OSX. I sold the damn notebook after a month of owning it. OSX blows. It's too dumbed down IMHO (as is Windows7, but that's another topic). In light of recent events where they fired a guy for showing that even more stupid iPad (great, a big iPhone that can't even call) to Wozniak and then going after Gizmodo, I have even more distain for them. So I really have no care to support them in any way shape or form. If the site works for Safari, fine. If not, oh well, change your USER_AGENT string or get Firefox/IE. As for CSS, inline styles, separation of logic, and all that other stuff you ASSUME I don't use -- you are very wrong. I just happen to use a lot of PHP to dynamically create various parts. In some cases I inline styles where they are used one time or used in a PHP function. I freely admit that there is some archaic code there too. Code that I'm not about to go back and re-factor at this stage. I know much more now than I did then. I would certainly do things differently, and the next time I get a wild-hair up my ass and a few days of that elusive commodity known as free time to code up a new design I will. Again, this is my personal site that's only purpose is to show some pictures and other random shit. And with all due respect Tedd -- as I know you're an icon here and I've learned many things from you myself. If I had to choose between my daevid.com site and one of the three you (presumably) illustrate as beacons of the way to do it (http://sperling.com http://ancientstones.com http://earthstones.com), then I would take my site any day of the week. These three sites harkon back to the
Re: [PHP] Re: Really impressive work
Nathan Rixham wrote: tedd wrote: Hi gang: I found something that really impressed me -- please review this: http://palomarjewelry.com/product/id/19/collectionId/1/typeId/3 Try changing the number and type of stones and watch the main image change (i.e., the basket). If one calculates the number of permutations required to show this single piece of jewelry with 12 different stone types located in 15 different stone positions, you will arrive at a very large number. The specific math escapes me at the moment but something in the order of 15 factorial -- a very large number. Now, I realize that this company did not take 15 factorial pictures of this single piece of jewelry to present all these different combinations but instead placed smaller images of each of the stones at specific coordinates on the larger image of the jewelry. I imagine that each piece of jewelry must have the coordinates of each setting in a database so that they can on-the-fly assemble the finished product as per user's direction. For example, let's take the image of the basket pendant showing three stones. Each of the stone locations would have a specific pixel placement (i.e., x,y). As such, the database would have a field for the image and three location fields for stones 1, 2, and 3. Now, we also have smaller images of 12 different stones (in heads) that are all the same size. Thus, as the user picks the stones and positions they want and the image is assembled on the fly. Is that the way you see this? Or is there a better way? Better way, no. Alternative ways, yes. SVG Canvas + JS HTML4 + CSS + JS (optional transparent pngs) Flash Any number of java plugins (although perhaps overkill). Personally though, I'd go for SVG or the way it is currently implemented with server side gd or suchlike. The reason for saying this is to ensure that the results were identical on as many platforms as possible - the one addition I would make would be an update image button which displayed on noscript, which resubmitted the page / form and showed the image - for those without (or with non compliant) js implementations. I tend to agree that it's impressive, personally I don't think the code behind it rocket science; however the idea to peice what is essentially how many numbers do you want, what are those numbers together in such a user pleasing and useful way, is definately something to applaud :) I would use PNGs with alpha transparencies. You have X images with the appropriate positions and then you just overlay an alpha transparency PNG in the correct spot via CSS. Pretty simple actually. Relative position the ring, absolute position the stone relative to the ring. Even IE6 will support this with pngfix.js. Viewing the page media in Firefox though shows they are generating it server side though. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] In need of CVS/SVN checkout script for Production servers [solved]
On Wed, May 5, 2010 at 9:27 PM, Nathan Rixham nrix...@gmail.com wrote: Daevid Vincent wrote: -Original Message- From: tedd [mailto:tedd.sperl...@gmail.com] Sent: Wednesday, May 05, 2010 8:19 AM To: Daevid Vincent; php-general@lists.php.net Subject: RE: [PHP] In need of CVS/SVN checkout script for Production servers [solved] At 1:10 PM -0700 5/4/10, Daevid Vincent wrote: Well, here is the one I'm using. I ended up just writing one (again!) http://www.daevid.com/content/examples/snippets.php :: Production Deployment Script What?!? Advanced features?? I know you don't mean it, but you certainly know how to piss people off. You are not going to like what I have to say, but please accept the following as constructive criticism with no personal intent meant. The site fails W3C CSS validation with 96 errors. The site fails W3C HTML validation with 92 errors and 9 warnings. I have not run into a site like this since before the turn of this century where we had browser wars. The problem isn't just with my browser, but many more as you can see here: http://www.browsercam.com/public.aspx?proj_id=516739 The page (not addressing the entire site) is riddled with embedded javascript and embedded styling both of which are considered bad from. I haven't even addressed accessibility, graceful degradation, or separation of content from presentation from behavior all of which are the goals of best practices sites -- and all of which this site fails miserably. My advice, which I realize that you didn't ask for, is if you want to provide something of substance, then do so for all and not just the privileged elite who think they are the leading edge with this type of gimmick nonsense. This site is a step backward into the old browser wars. Of course, I could tell you what I really think, but I don't want to be too abrasive. :-) Cheers, tedd *sigh* once again you people focus on something S off topic compared to the meat of the thread -- which is a production repository checkout script. As for my site. [*] I wrote it like 4 years ago or more when there were TWO browsers worth mentioning: IE and FF. [*] I used a 3rd party JS library from www.ceiton.com -- who are pretty much dormant. [*] The cieton code is not only compressed and impossible to debug, but often written in German! [*] I've looked at it a few times over the years to try and remove the limitation, because I also agree that most modern browsers should be able to handle the JS at this point. [*] I really don't care about the fringe browsers of Chrome, Opera, Konquerer, Blackberry, whatever (for my PERSONAL HOME PAGE) [*] http://www.w3schools.com/browsers/browsers_stats.asp [*] http://marketshare.hitslink.com/report.aspx?qprid=0 [*] I'm sorry your using a browser that falls under the top 25%. In fact ALL the browsers besides IE and FF don't even add up to 16% of the ENTIRE market. Give me a break man. I've got more important things to do. [*] If you don't have Firefox, well then let me tell you where to go download it for free: http://www.mozilla.com They make it for all major OS's in case you didn't know. [*] Honestly, I also dislike Apple. I think it's stupid for them to make a browser. I think they make crappy products. I HATE my iPod. I am a Linux guy (or was until I realized my time was too valuable to keep wasting on Linux as a Desktop), and WANTED to LOVE OSX. I sold the damn notebook after a month of owning it. OSX blows. It's too dumbed down IMHO (as is Windows7, but that's another topic). In light of recent events where they fired a guy for showing that even more stupid iPad (great, a big iPhone that can't even call) to Wozniak and then going after Gizmodo, I have even more distain for them. So I really have no care to support them in any way shape or form. If the site works for Safari, fine. If not, oh well, change your USER_AGENT string or get Firefox/IE. As for CSS, inline styles, separation of logic, and all that other stuff you ASSUME I don't use -- you are very wrong. I just happen to use a lot of PHP to dynamically create various parts. In some cases I inline styles where they are used one time or used in a PHP function. I freely admit that there is some archaic code there too. Code that I'm not about to go back and re-factor at this stage. I know much more now than I did then. I would certainly do things differently, and the next time I get a wild-hair up my ass and a few days of that elusive commodity known as free time to code up a new design I will. Again, this is my personal site that's only purpose is to show some pictures and other random shit. And with all due respect Tedd -- as I know you're an icon here and I've learned many things from you myself. If I had to choose between my daevid.com site and one of the three you (presumably) illustrate as beacons of the way to do it (http://sperling.com