From vtbludgeon at gmail.com Tue Jun 2 12:22:52 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Tue, 2 Jun 2009 12:22:52 -0400 Subject: [nycphp-talk] PHP 5 Interfaces In-Reply-To: <1243371222.10844.297.camel@mikeh-ubuntu> References: <8F2745B2-24A1-48A7-9FB8-87526860D049@gmail.com> <1243371222.10844.297.camel@mikeh-ubuntu> Message-ID: <721f1cc50906020922q75c78c4bub15d74ea36362213@mail.gmail.com> We might add that interfaces can be useful for type-hinting in your method signature, possibly saving you some extra defensive-coding and checking what was passed in. public function doSomething(Fooable $fooable) { // you can count on $fooable implementing Fooable // or you won't get this far w/o a fatal } -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Tue Jun 2 12:35:38 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Tue, 2 Jun 2009 12:35:38 -0400 Subject: [nycphp-talk] NYPHP Tech In-Reply-To: <4A1E062C.30005@nyc.rr.com> References: <000001c9df24$48223d70$d866b850$@com> <4A1E062C.30005@nyc.rr.com> Message-ID: <721f1cc50906020935h23faaf1j704643aabcb3c5a2@mail.gmail.com> 2009/5/27 Joey Derrico > Sounds ok with me > > Joey > > Peter Sawczynec wrote: > > Good Day All: > > > > Would anyone support a new SIG called maybe "NYPHP Tech" or "NYPHP > Techcetera". > > > > In this SIG we could all post w/o guilt all our tech and tech-related > questions, things such as: > > 1) best laptop > > 2) best linux distro > > 3) best google map mashup > > 4) best wireless hotspot provider > > 5) best computer store online > > 6) most tech friendly airline > > 7) best hi-energy drink for computer work > > 8) SEO questions > > 9) best city for tech jobs > > 10) best smart phone(s) > > 11) best? > > > > I personally would love this. Because I really respect the people on this > list and I know > > they know technology real well not just PHP. > > > > What do you think? > > Great idea. I've been thinking (following our long thread about Verizon FIOS, technology etc.) that we could use a OffTopic-Sig for the same reason, i.e., there's a lot of stuff that isn't On Topic that one enjoys discussing with these list-people. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From krozinov at gmail.com Tue Jun 2 16:11:29 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Tue, 2 Jun 2009 16:11:29 -0400 Subject: [nycphp-talk] stopping comment spam with PHP Message-ID: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> Hi guys, I'm interested in hearing what kind of classes, packages, solutions the professionals on this list use to protect their sites against spam in relation to comments. For example, users commenting on other user's pages like Facebook or any social networking site. I am not using WordPress, Drupal, or other CMS, blog software, frameworks, so plugins for those won't work, but maybe I can learn something from them. Basically, I'm interested in hearing opinions on different options to block comment spam. Currently, I'm only using a visual CAPTCHA, but I'm afraid that that is easily defeatable. I've also heard of using hidden form fields, and checking if they're filled in or not on the backend when the form is processed. Any other ideas? Thanks, Konstantin From sequethin at gmail.com Tue Jun 2 16:18:29 2009 From: sequethin at gmail.com (Michael Hernandez) Date: Tue, 02 Jun 2009 16:18:29 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> Message-ID: <1243973909.25060.284.camel@mikeh-ubuntu> On Tue, 2009-06-02 at 16:11 -0400, Konstantin Rozinov wrote: > Hi guys, > > I'm interested in hearing what kind of classes, packages, solutions > the professionals on this list use to protect their sites against spam > in relation to comments. > For example, users commenting on other user's pages like Facebook or > any social networking site. > > I am not using WordPress, Drupal, or other CMS, blog software, > frameworks, so plugins for those won't work, but maybe I can learn > something from them. > > Basically, I'm interested in hearing opinions on different options to > block comment spam. > > Currently, I'm only using a visual CAPTCHA, but I'm afraid that that > is easily defeatable. > > I've also heard of using hidden form fields, and checking if they're > filled in or not on the backend when the form is processed. > > Any other ideas? Zend Framework has an akismet service component that you might find useful: http://framework.zend.com/manual/en/zend.service.akismet.html Akismet helps my wordpress blog stay pretty much 100% free of comment spam, though I do get occasional spam user sign-ups... --Mike H From chsnyder at gmail.com Tue Jun 2 16:19:28 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 2 Jun 2009 16:19:28 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> Message-ID: On Tue, Jun 2, 2009 at 4:11 PM, Konstantin Rozinov wrote: > Basically, I'm interested in hearing opinions on different options to > block comment spam. Comment spam is pretty similar to email spam -- there are a bunch of tricks you can use to slow down dumb scripts, but then the scripts get smarter and you're back to square one. Hidden form fields, randomized form field names, and even captchas can all be defeated once the spambots get smart enough. Akismet takes a different approach -- it basically acts as a global spam filter, though as the risk of false positives. http://akismet.com/ You could do the same thing by running all of your comments through a GMail inbox. The idea is to use the powerful tools that have already been developed for email spam, and also to make it "someone else's problem" so that you don't have to spend any more time on it. Chris Snyder http://chxor.chxo.com/ From hans at cyberxdesigns.com Tue Jun 2 16:23:56 2009 From: hans at cyberxdesigns.com (Hans C. Kaspersetz) Date: Tue, 2 Jun 2009 16:23:56 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> Message-ID: <20090602202358.DC43B1CB24AF@lists.nyphp.org> I am not using WordPress, Drupal, or other CMS, blog software, frameworks, so plugins for those won't work, but maybe I can learn something from them. Konstantin, You might consider looking at http://akismet.com/. This is the data/API provider that the WordPress plugin uses. You can get a key and then access their API using your application. You will have the opportunity to check your comments against a HUGE database of comments from WordPress blogs and other sites all over the world. Plus, if you choose to, you can contribute to the database by classifying the comments as spam or not as you approve them. I believe there are other technologies that offer comparable services, however I am not as familiar with them. Warmest regards, Hans Kaspersetz Cyber X Designs, http://www.cyberxdesigns.com, builds promotional websites, ecommerce websites, and portals with open source technologies for companies world wide. From hans at cyberxdesigns.com Tue Jun 2 16:31:50 2009 From: hans at cyberxdesigns.com (Hans C. Kaspersetz) Date: Tue, 2 Jun 2009 16:31:50 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <20090602202358.DC43B1CB24AF@lists.nyphp.org> Message-ID: <20090602203152.765DE1CB24B0@lists.nyphp.org> I think we have a consensus when three people give the same answer in 12 minutes. Great minds do really think alike. Hans K From dorgan at donaldorgan.com Tue Jun 2 16:37:37 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Tue, 2 Jun 2009 16:37:37 -0400 (EDT) Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <20090602203152.765DE1CB24B0@lists.nyphp.org> Message-ID: <23163849.6781243975057768.JavaMail.root@twoguyshosting.com.> you can also create a "hidden" input not type="hidden" use CSS to hide it, that never gets filled out by people visiting the site...but spam bots tend to fill out all visible inputs :) ----- Original Message ----- From: "Hans C. Kaspersetz" To: "NYPHP Talk" Sent: Tuesday, June 2, 2009 4:31:50 PM Subject: Re: [nycphp-talk] stopping comment spam with PHP I think we have a consensus when three people give the same answer in 12 minutes. Great minds do really think alike. Hans K _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From paul at devonianfarm.com Tue Jun 2 16:38:34 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Tue, 02 Jun 2009 16:38:34 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> Message-ID: <4A258DCA.6040102@devonianfarm.com> Konstantin Rozinov wrote: > Hi guys, > > I'm interested in hearing what kind of classes, packages, solutions > the professionals on this list use to protect their sites against spam > in relation to comments. > For example, users commenting on other user's pages like Facebook or > any social networking site. > > No matter what technological measures you use, you'll need a user interface to make hand edits. For instance, my site at http://spoonriveranthology.net/ uses Disqus for comments because I didn't have time to develop a good commenting system for that site. Disqus is a service that runs on a central server that transcludes comments into your site with Javascript: it gives you a pretty decent threaded commenting system with an admin UI, spam defense and other good features. There's a similar service from IntenseDebate, which is also pretty good... I just picked Disqus because I had to pick something. When I first made that site, I had a comment system that was packed as a symfony plug-in. I had a battle with a spammer: I found it easier to delete his crap with the SQL monitor than with the UI that came with the comment system. I managed to stop him by filtering on certain words and blocking any attempt to post links, but it wasn't a good answer. Recently I switched to Disqus comments. This has increased the average # of pages per visit on the site from 8 to 10. It took about an hour to Disqus. Today, the main problem is that that site appeals to a teen audience. Some of the comments are brilliant, but some are absurdly stupid and I delete them to keep the discussion readable. I was able to get Disqus integrated with my site in about an hour. Disqus has a good API for getting your comments in and out, so it's not a roach motel like the Facebook or Google Friend Connect Comments. I could import my old comments into Disqus, but I haven't gotten around to it. From jcampbell1 at gmail.com Tue Jun 2 16:47:34 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 2 Jun 2009 16:47:34 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <4A258DCA.6040102@devonianfarm.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <4A258DCA.6040102@devonianfarm.com> Message-ID: <8f0676b40906021347k2fb168ag3da1f68f9efffeb3@mail.gmail.com> You should also make sure your comment system is using rel="nofollow", and doesn't have any XSS issues. If you aren't using rel="nofollow", and the site has page rank, then it will be worth the spammer's time to manually defeat your form. From chsnyder at gmail.com Tue Jun 2 16:51:32 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 2 Jun 2009 16:51:32 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <4A258DCA.6040102@devonianfarm.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <4A258DCA.6040102@devonianfarm.com> Message-ID: On Tue, Jun 2, 2009 at 4:38 PM, Paul A Houle wrote: > ? No matter what technological measures you use, ?you'll need a user > interface to make hand edits. ?For instance, ?my site at > > http://spoonriveranthology.net/ > > ? uses Disqus for comments because I didn't have time to develop a good > commenting system for that site. ?Disqus is a service that runs on a central > server that transcludes comments into your site with Javascript: ?it gives > you a pretty decent threaded commenting system with an admin UI, ?spam > defense and other good features. ?There's a similar service from > IntenseDebate, ?which is also pretty good... ?I just picked Disqus because I > had to pick something. Agreed, using Disqus is easy. I use it for my blog, which I don't really expect comments on. I would not use it long term if comments were really important to me, for three reasons: 1) Requires javascript, which pisses off smart people 2) Introduces visual clutter 3) Your comments are now split from your content Reason three is probably the most important, long term. If Disqus goes away, or messes something up all of your comments are gone. If you change the URI of the page, all that page's comments are gone. Also, Google doesn't index your comments with your site. It's a great service, but balance that against the potential consequences before you use it. From chsnyder at gmail.com Tue Jun 2 16:53:12 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 2 Jun 2009 16:53:12 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <8f0676b40906021347k2fb168ag3da1f68f9efffeb3@mail.gmail.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <4A258DCA.6040102@devonianfarm.com> <8f0676b40906021347k2fb168ag3da1f68f9efffeb3@mail.gmail.com> Message-ID: On Tue, Jun 2, 2009 at 4:47 PM, John Campbell wrote: > You should also make sure your comment system is using rel="nofollow", > and doesn't have any XSS issues. > > If you aren't using rel="nofollow", and the site has page rank, then > it will be worth the spammer's time to manually defeat your form. If only that was true. I've had rel="nofollow" in my comments froms since 2003 and I still get dumb spammers who either don't know or don't care. From jcampbell1 at gmail.com Tue Jun 2 17:36:22 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Tue, 2 Jun 2009 17:36:22 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <4A258DCA.6040102@devonianfarm.com> <8f0676b40906021347k2fb168ag3da1f68f9efffeb3@mail.gmail.com> Message-ID: <8f0676b40906021436p4371e587mb6838359e96524b0@mail.gmail.com> On Tue, Jun 2, 2009 at 4:53 PM, Chris Snyder wrote: > I've had rel="nofollow" in my comments froms since 2003 and I still > get dumb spammers who either don't know or don't care. Wow, I am impressed. Google announced nofollow in 2005, and you already had it implemented for two years. :) -jc From chsnyder at gmail.com Tue Jun 2 17:38:02 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 2 Jun 2009 17:38:02 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <8f0676b40906021436p4371e587mb6838359e96524b0@mail.gmail.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <4A258DCA.6040102@devonianfarm.com> <8f0676b40906021347k2fb168ag3da1f68f9efffeb3@mail.gmail.com> <8f0676b40906021436p4371e587mb6838359e96524b0@mail.gmail.com> Message-ID: On Tue, Jun 2, 2009 at 5:36 PM, John Campbell wrote: > On Tue, Jun 2, 2009 at 4:53 PM, Chris Snyder wrote: >> I've had rel="nofollow" in my comments froms since 2003 and I still >> get dumb spammers who either don't know or don't care. > > Wow, I am impressed. ?Google announced nofollow in 2005, and you > already had it implemented for two years. :) > > -jc Fair cop. But that's still four years worth of spam with rel="nofollow". From dan.horning at planetnoc.com Tue Jun 2 17:43:08 2009 From: dan.horning at planetnoc.com (Daniel Horning) Date: Tue, 2 Jun 2009 17:43:08 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <4A258DCA.6040102@devonianfarm.com> <8f0676b40906021347k2fb168ag3da1f68f9efffeb3@mail.gmail.com> <8f0676b40906021436p4371e587mb6838359e96524b0@mail.gmail.com> Message-ID: <000001c9e3cb$1f5a7d20$5e0f7760$@horning@planetnoc.com> A quick aside to the nature of IntenseDebate They give you access in a database to all your comments - during the beta I had it setup to autobackup the comments once approved to my blog. -- Dan Horning American Digital Services - Where you are only limited by imagination. dan.horning at planetnoc.com :: http://www.americandigitalservices.com 1-518-444-0213 x502 . toll free 1-800-863-3854 . fax 1-888-474-6133 15 Third Street, PO Box 746, Troy, NY 12180 (by appointment only) > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] On Behalf Of Chris Snyder > Sent: Tuesday, June 02, 2009 5:38 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] stopping comment spam with PHP > > On Tue, Jun 2, 2009 at 5:36 PM, John Campbell > wrote: > > On Tue, Jun 2, 2009 at 4:53 PM, Chris Snyder > wrote: > >> I've had rel="nofollow" in my comments froms since 2003 and I still > >> get dumb spammers who either don't know or don't care. > > > > Wow, I am impressed. Google announced nofollow in 2005, and you > > already had it implemented for two years. :) > > > > -jc > > Fair cop. But that's still four years worth of spam with > rel="nofollow". > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From krozinov at gmail.com Tue Jun 2 18:49:55 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Tue, 2 Jun 2009 18:49:55 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <20090602202358.DC43B1CB24AF@lists.nyphp.org> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <20090602202358.DC43B1CB24AF@lists.nyphp.org> Message-ID: <865a7acf0906021549l118afaa5i4c495dbb93adb07e@mail.gmail.com> Thanks guys for the info and links. I will check out akismet and Disqus. I also found this article, which was a simple explanation of some techniques using hidden fields: http://www.rustylime.com/show_article.php?id=676 I'll let you all know if I find anything interesting regarding this topic. Konstantin On Tue, Jun 2, 2009 at 4:23 PM, Hans C. Kaspersetz wrote: > I am not using WordPress, Drupal, or other CMS, blog software, frameworks, > so plugins for those won't work, but maybe I can learn something from them. > > > > Konstantin, > > You might consider looking at http://akismet.com/. ?This is the data/API > provider that the WordPress plugin uses. ?You can get a key and then access > their API using your application. ?You will have the opportunity to check > your comments against a HUGE database of comments from WordPress blogs and > other sites all over the world. Plus, if you choose to, you can contribute > to the database by classifying the comments as spam or not as you approve > them. > > I believe there are other technologies that offer comparable services, > however I am not as familiar with them. > > Warmest regards, > Hans Kaspersetz > > Cyber X Designs, http://www.cyberxdesigns.com, builds promotional websites, > ecommerce websites, and portals with open source technologies for companies > world wide. > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From mitch.pirtle at gmail.com Wed Jun 3 11:57:24 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 3 Jun 2009 11:57:24 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <865a7acf0906021549l118afaa5i4c495dbb93adb07e@mail.gmail.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <20090602202358.DC43B1CB24AF@lists.nyphp.org> <865a7acf0906021549l118afaa5i4c495dbb93adb07e@mail.gmail.com> Message-ID: <330532b60906030857v56c09771ucec8b1ecf104f343@mail.gmail.com> You should also check out Mollom, integrates with a great many platforms and is having rapid growth/success: http://mollom.com/ -- Mitch On Tue, Jun 2, 2009 at 6:49 PM, Konstantin Rozinov wrote: > Thanks guys for the info and links. ?I will check out akismet and Disqus. > > I also found this article, which was a simple explanation of some > techniques using hidden fields: > http://www.rustylime.com/show_article.php?id=676 > > I'll let you all know if I find anything interesting regarding this topic. > > Konstantin > > > On Tue, Jun 2, 2009 at 4:23 PM, Hans C. Kaspersetz > wrote: >> I am not using WordPress, Drupal, or other CMS, blog software, frameworks, >> so plugins for those won't work, but maybe I can learn something from them. >> >> >> >> Konstantin, >> >> You might consider looking at http://akismet.com/. ?This is the data/API >> provider that the WordPress plugin uses. ?You can get a key and then access >> their API using your application. ?You will have the opportunity to check >> your comments against a HUGE database of comments from WordPress blogs and >> other sites all over the world. Plus, if you choose to, you can contribute >> to the database by classifying the comments as spam or not as you approve >> them. >> >> I believe there are other technologies that offer comparable services, >> however I am not as familiar with them. >> >> Warmest regards, >> Hans Kaspersetz >> >> Cyber X Designs, http://www.cyberxdesigns.com, builds promotional websites, >> ecommerce websites, and portals with open source technologies for companies >> world wide. >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From krozinov at gmail.com Wed Jun 3 14:52:19 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Wed, 3 Jun 2009 14:52:19 -0400 Subject: [nycphp-talk] stopping comment spam with PHP In-Reply-To: <330532b60906030857v56c09771ucec8b1ecf104f343@mail.gmail.com> References: <865a7acf0906021311l3b560e67w2936eda5fa899e3@mail.gmail.com> <20090602202358.DC43B1CB24AF@lists.nyphp.org> <865a7acf0906021549l118afaa5i4c495dbb93adb07e@mail.gmail.com> <330532b60906030857v56c09771ucec8b1ecf104f343@mail.gmail.com> Message-ID: <865a7acf0906031152w13610b90v6c3f558116a6ce1d@mail.gmail.com> mollom.com looks interesting because they also offer a dedicated high-availability solution whereby you can host their service on your own servers, especially if you've got the traffic. Thanks for that link! Basically, I'm looking into Akismet and Mollom at this point. Very interested in the dedicated, high-availability, and high performance solutions for comment spam. On Wed, Jun 3, 2009 at 11:57 AM, Mitch Pirtle wrote: > You should also check out Mollom, integrates with a great many > platforms and is having rapid growth/success: > > http://mollom.com/ > > -- Mitch > > On Tue, Jun 2, 2009 at 6:49 PM, Konstantin Rozinov wrote: >> Thanks guys for the info and links. ?I will check out akismet and Disqus. >> >> I also found this article, which was a simple explanation of some >> techniques using hidden fields: >> http://www.rustylime.com/show_article.php?id=676 >> >> I'll let you all know if I find anything interesting regarding this topic. >> >> Konstantin >> >> >> On Tue, Jun 2, 2009 at 4:23 PM, Hans C. Kaspersetz >> wrote: >>> I am not using WordPress, Drupal, or other CMS, blog software, frameworks, >>> so plugins for those won't work, but maybe I can learn something from them. >>> >>> >>> >>> Konstantin, >>> >>> You might consider looking at http://akismet.com/. ?This is the data/API >>> provider that the WordPress plugin uses. ?You can get a key and then access >>> their API using your application. ?You will have the opportunity to check >>> your comments against a HUGE database of comments from WordPress blogs and >>> other sites all over the world. Plus, if you choose to, you can contribute >>> to the database by classifying the comments as spam or not as you approve >>> them. >>> >>> I believe there are other technologies that offer comparable services, >>> however I am not as familiar with them. >>> >>> Warmest regards, >>> Hans Kaspersetz >>> >>> Cyber X Designs, http://www.cyberxdesigns.com, builds promotional websites, >>> ecommerce websites, and portals with open source technologies for companies >>> world wide. >>> >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From mmwaldman at nyc.rr.com Wed Jun 3 19:54:43 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 3 Jun 2009 19:54:43 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability Message-ID: <20090603235636309.UARY23263@hrndva-omta02.mail.rr.com> For those of you that want to join my browsercam.com group, I have space available. There's 2 of us, so I have 10 slots open. It's roughly $40/mo for a regular membership. It's like $60 bucks for a one time temporary use. To join my group it's like $50/year. I'll look up the specifics later. Like $50 give or take a buck or two. What can you do with browsercam? View screen shots of your developed websites in browsers you don't have installed on your computer. I don't need it right now. But, even if you only need it once a year, you already have a membership, so you don't have to sign up and you save $10 bucks, so when you're busy working it will save you time in getting on with the development. How many times have you thought, "I wonder what it looks like in IE6?" So, join a group now. Email me directly if you're interested. Margaret Michele Waldman Sovereign Sites L.L.C. Website Development 646-861-3375 Rule your domain ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From consult at covenantedesign.com Wed Jun 3 20:07:24 2009 From: consult at covenantedesign.com (CED) Date: Wed, 03 Jun 2009 20:07:24 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090603235636309.UARY23263@hrndva-omta02.mail.rr.com> References: <20090603235636309.UARY23263@hrndva-omta02.mail.rr.com> Message-ID: <4A27103C.9040203@covenantedesign.com> Have you looked into https://browserlab.adobe.com/index.html Michele Waldman wrote: > > For those of you that want to join my browsercam.com group, I have > space available. There?s 2 of us, so I have 10 slots open. > > It?s roughly $40/mo for a regular membership. It?s like $60 bucks for > a one time temporary use. > > To join my group it?s like $50/year. I?ll look up the specifics later. > Like $50 give or take a buck or two. > > What can you do with browsercam? View screen shots of your developed > websites in browsers you don?t have installed on your computer. > > I don?t need it right now. But, even if you only need it once a year, > you already have a membership, so you don?t have to sign up and you > save $10 bucks, so when you?re busy working it will save you time in > getting on with the development. How many times have you thought, ?I > wonder what it looks like in IE6?? So, join a group now. > > Email me directly if you?re interested. > > Margaret Michele Waldman > > Sovereign Sites L.L.C. > > Website Development > > 646-861-3375 > > Rule your domain ... > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From ramons at gmx.net Wed Jun 3 20:10:37 2009 From: ramons at gmx.net (David Krings) Date: Wed, 03 Jun 2009 20:10:37 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090603235636309.UARY23263@hrndva-omta02.mail.rr.com> References: <20090603235636309.UARY23263@hrndva-omta02.mail.rr.com> Message-ID: <4A2710FD.4030602@gmx.net> Michele Waldman wrote: > on with the development. How many times have you thought, ?I wonder > what it looks like in IE6?? So, join a group now. I don't want to rain on your parade, but isn't that something a VM and the IE package from Tredosoft can do? Does browsercam do something that the regular IE instances can't do? When I test browser based apps at work I have one Windows VM and a Linux VM with all the popular and not so popular browsers including IE from version 3.0 up. That covers all rendering engines and about all OS (after all Mac OS X is just a window manager on top of BSD, but I also got a Mac for testing). I recently transferred those VMs from Workstation to Server 2.0 so that I can run it one a different box. And with the free TechNet accounts that Microsoft gives out I could even run the IEs natively on yet another set of VMs. David From mmwaldman at nyc.rr.com Wed Jun 3 20:14:37 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 3 Jun 2009 20:14:37 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <4A27103C.9040203@covenantedesign.com> Message-ID: <20090604001629411.UVPI23263@hrndva-omta02.mail.rr.com> "Limited Free Preview The BrowserLab free preview is available to a limited number of users, while we monitor its performance. Please visit our service status page for updates." I've never seen an Abobe product for free. I can't afford abobe, wish I could, but when development's finished, I'd guess it will be outside of my budget. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of CED > Sent: Wednesday, June 03, 2009 8:07 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > Have you looked into https://browserlab.adobe.com/index.html > > > Michele Waldman wrote: > > > > For those of you that want to join my browsercam.com group, I have > > space available. There's 2 of us, so I have 10 slots open. > > > > It's roughly $40/mo for a regular membership. It's like $60 bucks for > > a one time temporary use. > > > > To join my group it's like $50/year. I'll look up the specifics later. > > Like $50 give or take a buck or two. > > > > What can you do with browsercam? View screen shots of your developed > > websites in browsers you don't have installed on your computer. > > > > I don't need it right now. But, even if you only need it once a year, > > you already have a membership, so you don't have to sign up and you > > save $10 bucks, so when you're busy working it will save you time in > > getting on with the development. How many times have you thought, "I > > wonder what it looks like in IE6?" So, join a group now. > > > > Email me directly if you're interested. > > > > Margaret Michele Waldman > > > > Sovereign Sites L.L.C. > > > > Website Development > > > > 646-861-3375 > > > > Rule your domain ... > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From mmwaldman at nyc.rr.com Wed Jun 3 20:24:47 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 3 Jun 2009 20:24:47 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <4A2710FD.4030602@gmx.net> Message-ID: <20090604002639386.RKFM6499@hrndva-omta03.mail.rr.com> Don't work you aren't raining on my parade. It's more like a trail of tears for me. (If you don't know what a trail of tears is then you can Yahoo! It.) I've had problems with running virtual machines on my computer. The last time I tried it failed on me and I didn't have more time to look into it. Using this website saves me from having a ton of more software loaded on my one overloaded ancient pc. I don't need it extensively so it's a good solution for me. If I was doing more heavy css testing I might have to consider something else, but it fits my needs of periodic testing. If you have a group subscription then the price is nominal. Plus, I don't test one at a time. I select many browsers at once and in renders them all about 15 minutes later, while I'm doing something else. If there's a specific problem, then I can put my attention to it. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of David Krings > Sent: Wednesday, June 03, 2009 8:11 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > Michele Waldman wrote: > > on with the development. How many times have you thought, "I wonder > > what it looks like in IE6?" So, join a group now. > > I don't want to rain on your parade, but isn't that something a VM and the > IE > package from Tredosoft can do? Does browsercam do something that the > regular > IE instances can't do? When I test browser based apps at work I have one > Windows VM and a Linux VM with all the popular and not so popular browsers > including IE from version 3.0 up. That covers all rendering engines and > about > all OS (after all Mac OS X is just a window manager on top of BSD, but I > also > got a Mac for testing). I recently transferred those VMs from Workstation > to > Server 2.0 so that I can run it one a different box. And with the free > TechNet > accounts that Microsoft gives out I could even run the IEs natively on yet > another set of VMs. > > David > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From consult at covenantedesign.com Wed Jun 3 21:06:29 2009 From: consult at covenantedesign.com (CED) Date: Wed, 03 Jun 2009 21:06:29 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090604001629411.UVPI23263@hrndva-omta02.mail.rr.com> References: <20090604001629411.UVPI23263@hrndva-omta02.mail.rr.com> Message-ID: <4A271E15.2080706@covenantedesign.com> yeah you just missed it. :( However, word is, it's not going to be very expensive, and it will have plugins across the adobe suite. Adobe Actionscript(Flash), Flex/MXML and AIR are free, you can find the compilers on adobelabs. Michele Waldman wrote: > "Limited Free Preview > The BrowserLab free preview is available to a limited number of users, while > we monitor its performance. Please visit our service status page for > updates." > > I've never seen an Abobe product for free. I can't afford abobe, wish I > could, but when development's finished, I'd guess it will be outside of my > budget. > > Michele > > >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of CED >> Sent: Wednesday, June 03, 2009 8:07 PM >> To: NYPHP Talk >> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability >> >> Have you looked into https://browserlab.adobe.com/index.html >> >> >> Michele Waldman wrote: >> >>> For those of you that want to join my browsercam.com group, I have >>> space available. There's 2 of us, so I have 10 slots open. >>> >>> It's roughly $40/mo for a regular membership. It's like $60 bucks for >>> a one time temporary use. >>> >>> To join my group it's like $50/year. I'll look up the specifics later. >>> Like $50 give or take a buck or two. >>> >>> What can you do with browsercam? View screen shots of your developed >>> websites in browsers you don't have installed on your computer. >>> >>> I don't need it right now. But, even if you only need it once a year, >>> you already have a membership, so you don't have to sign up and you >>> save $10 bucks, so when you're busy working it will save you time in >>> getting on with the development. How many times have you thought, "I >>> wonder what it looks like in IE6?" So, join a group now. >>> >>> Email me directly if you're interested. >>> >>> Margaret Michele Waldman >>> >>> Sovereign Sites L.L.C. >>> >>> Website Development >>> >>> 646-861-3375 >>> >>> Rule your domain ... >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > > From michael.southwell at nyphp.com Wed Jun 3 21:14:14 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Wed, 03 Jun 2009 21:14:14 -0400 Subject: [nycphp-talk] delete one element from array Message-ID: <4A271FE6.9060209@nyphp.com> This has to be easy but I'm so pre-occupied with other stuff that I can't get it. I have an array, let's say 12 elements. I want to remove element 7. I could array_slice out the first 6 and also the last 5 and then combine those resulting arrays but that seems like a very tedious way to do it. There has to be an easier way???????? -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From dsteplight at gmail.com Wed Jun 3 21:17:19 2009 From: dsteplight at gmail.com (Darryle Steplight) Date: Wed, 3 Jun 2009 21:17:19 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <4A271FE6.9060209@nyphp.com> References: <4A271FE6.9060209@nyphp.com> Message-ID: <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> unset($array['7']) doesn't work? On Wed, Jun 3, 2009 at 9:14 PM, Michael Southwell wrote: > This has to be easy but I'm so pre-occupied with other stuff that I can't > get it. > > I have an array, let's say 12 elements. I want to remove element 7. I could > array_slice out the first 6 and also the last 5 and then combine those > resulting arrays but that seems like a very tedious way to do it. There has > to be an easier way???????? > -- > ================= > Michael Southwell > Vice President, Education > NYPHP TRAINING: ?http://nyphp.com/Training/Indepth > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- A: It reverses the normal flow of conversation. Q: What's wrong with top-posting? A: Top-posting. Q: What's the biggest scourge on plain text email discussions? From consult at covenantedesign.com Wed Jun 3 21:23:33 2009 From: consult at covenantedesign.com (CED) Date: Wed, 03 Jun 2009 21:23:33 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> Message-ID: <4A272215.4050507@covenantedesign.com> Darryle Steplight wrote: > unset($array['7']) doesn't work? > > On Wed, Jun 3, 2009 at 9:14 PM, Michael Southwell > wrote: > >> This has to be easy but I'm so pre-occupied with other stuff that I can't >> get it. >> >> I have an array, let's say 12 elements. I want to remove element 7. I could >> array_slice out the first 6 and also the last 5 and then combine those >> resulting arrays but that seems like a very tedious way to do it. There has >> to be an easier way???????? >> -- >> ================= >> Michael Southwell >> Vice President, Education >> NYPHP TRAINING: http://nyphp.com/Training/Indepth >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> >> > > > > Sarcasm? From michael.southwell at nyphp.com Wed Jun 3 21:23:45 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Wed, 03 Jun 2009 21:23:45 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> Message-ID: <4A272221.6090109@nyphp.com> Darryle Steplight wrote: > unset($array['7']) doesn't work? I said it would be easy....... -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From oorza2k5 at gmail.com Wed Jun 3 21:26:13 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Wed, 3 Jun 2009 21:26:13 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> Message-ID: <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> Nope, because that'll unset the eighth element! You want unset($array[6]) :P And then if you want to re-key the array: array_slice($array) On Wed, Jun 3, 2009 at 9:17 PM, Darryle Steplight wrote: > unset($array['7']) doesn't work? > > On Wed, Jun 3, 2009 at 9:14 PM, Michael Southwell > wrote: > > This has to be easy but I'm so pre-occupied with other stuff that I can't > > get it. > > > > I have an array, let's say 12 elements. I want to remove element 7. I > could > > array_slice out the first 6 and also the last 5 and then combine those > > resulting arrays but that seems like a very tedious way to do it. There > has > > to be an easier way???????? > > -- > > ================= > > Michael Southwell > > Vice President, Education > > NYPHP TRAINING: http://nyphp.com/Training/Indepth > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > > > > -- > A: It reverses the normal flow of conversation. > Q: What's wrong with top-posting? > A: Top-posting. > Q: What's the biggest scourge on plain text email discussions? > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Wed Jun 3 21:40:56 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 3 Jun 2009 21:40:56 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <4A271FE6.9060209@nyphp.com> References: <4A271FE6.9060209@nyphp.com> Message-ID: <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> I think you want array_splice, rather than array_slice array_splice($arr,6,1); Regards, -John Campbell From oorza2k5 at gmail.com Wed Jun 3 21:43:35 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Wed, 3 Jun 2009 21:43:35 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> Message-ID: <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> unset() will work, but won't reset the numerical index, which is the only thing array_slice is being used for; if he needs the index in the same order, unset() is a better option as it's faster, but if he needs a re-index, we'd have to benchmark :] On Wed, Jun 3, 2009 at 9:40 PM, John Campbell wrote: > I think you want array_splice, rather than array_slice > > array_splice($arr,6,1); > > Regards, > -John Campbell > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at blu-studio.com Wed Jun 3 21:48:35 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Wed, 3 Jun 2009 21:48:35 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090604002639386.RKFM6499@hrndva-omta03.mail.rr.com> References: <4A2710FD.4030602@gmx.net> <20090604002639386.RKFM6499@hrndva-omta03.mail.rr.com> Message-ID: <007e01c9e4b6$93514f10$b9f3ed30$@com> This is just my exceptionally small irreverent dos centavos on this topic. For about two years now, it seems one has been pretty much able to develop almost anything desired using virtually any CSS and any JavaScript (and using big heavy image files to boot) in 1000+ pixel wide designs and its all good. And at this time, if one were to find that one needs to spend too much hard time reviewing browser compatibility issues, then it is almost axiomatic that the code itself is not sufficiently or democratically "cross browser and platform independent" enough in the first place. Essentially: a) don't use any IE specific code; b) don't use any code that does not run in IE; and c) especially important, don't use any code that don?t run in IE Mac. Just not ever. Do something else. Use some Flash gadget. If you don?t do a, b or c; all the code vets itself and will be browser independent and automagically run on old browsers too boot going way back. Lastly, try to use XHTML "Transitional" to be easy on yourself and all your friends. You'd be surprised how many "browser" compatibility issues are actually and simply issues. "Strict" breaks a lot of CSS and indirectly the JavaScript code. And that heartache is simply not necessary. Then browser compatibility issues seem to just vanish. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michele Waldman Sent: Wednesday, June 03, 2009 8:25 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability Don't work you aren't raining on my parade. It's more like a trail of tears for me. (If you don't know what a trail of tears is then you can Yahoo! It.) I've had problems with running virtual machines on my computer. The last time I tried it failed on me and I didn't have more time to look into it. Using this website saves me from having a ton of more software loaded on my one overloaded ancient pc. I don't need it extensively so it's a good solution for me. If I was doing more heavy css testing I might have to consider something else, but it fits my needs of periodic testing. If you have a group subscription then the price is nominal. Plus, I don't test one at a time. I select many browsers at once and in renders them all about 15 minutes later, while I'm doing something else. If there's a specific problem, then I can put my attention to it. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of David Krings > Sent: Wednesday, June 03, 2009 8:11 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > Michele Waldman wrote: > > on with the development. How many times have you thought, "I wonder > > what it looks like in IE6?" So, join a group now. > > I don't want to rain on your parade, but isn't that something a VM and the > IE > package from Tredosoft can do? Does browsercam do something that the > regular > IE instances can't do? When I test browser based apps at work I have one > Windows VM and a Linux VM with all the popular and not so popular browsers > including IE from version 3.0 up. That covers all rendering engines and > about > all OS (after all Mac OS X is just a window manager on top of BSD, but I > also > got a Mac for testing). I recently transferred those VMs from Workstation > to > Server 2.0 so that I can run it one a different box. And with the free > TechNet > accounts that Microsoft gives out I could even run the IEs natively on yet > another set of VMs. > > David > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From dsteplight at gmail.com Wed Jun 3 21:49:04 2009 From: dsteplight at gmail.com (Darryle Steplight) Date: Wed, 3 Jun 2009 21:49:04 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> Message-ID: <47f4c4570906031849w169defd9ka25031e543637b32@mail.gmail.com> There's a few ways to skin this cat but Eddie is right. Based one this email's title I think using unset() should suffice. On Wed, Jun 3, 2009 at 9:43 PM, Eddie Drapkin wrote: > unset() will work, but won't reset the numerical index, which is the only > thing array_slice is being used for; if he needs the index in the same > order, unset() is a better option as it's faster, but if he needs a > re-index, we'd have to benchmark :] > > On Wed, Jun 3, 2009 at 9:40 PM, John Campbell wrote: >> >> I think you want array_splice, rather than array_slice >> >> array_splice($arr,6,1); >> >> Regards, >> -John Campbell >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- A: It reverses the normal flow of conversation. Q: What's wrong with top-posting? A: Top-posting. Q: What's the biggest scourge on plain text email discussions? From artur at marnik.net Wed Jun 3 21:49:43 2009 From: artur at marnik.net (Artur Marnik) Date: Wed, 03 Jun 2009 21:49:43 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090604002639386.RKFM6499@hrndva-omta03.mail.rr.com> References: <20090604002639386.RKFM6499@hrndva-omta03.mail.rr.com> Message-ID: <4A272837.4070509@marnik.net> Hi Michele I really like what you are doing. Some tools are just to expensive for a casual programmer/designer. But if anyone is looking for a free tool take a look at: http://browsershots.org/ it has some ads on the page but it does the job done as well. Artur Michele Waldman wrote: > Don't work you aren't raining on my parade. It's more like a trail of tears > for me. (If you don't know what a trail of tears is then you can Yahoo! > It.) > > I've had problems with running virtual machines on my computer. The last > time I tried it failed on me and I didn't have more time to look into it. > > Using this website saves me from having a ton of more software loaded on my > one overloaded ancient pc. > > I don't need it extensively so it's a good solution for me. If I was doing > more heavy css testing I might have to consider something else, but it fits > my needs of periodic testing. If you have a group subscription then the > price is nominal. > > Plus, I don't test one at a time. I select many browsers at once and in > renders them all about 15 minutes later, while I'm doing something else. > > If there's a specific problem, then I can put my attention to it. > > Michele > >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of David Krings >> Sent: Wednesday, June 03, 2009 8:11 PM >> To: NYPHP Talk >> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability >> >> Michele Waldman wrote: >> >>> on with the development. How many times have you thought, "I wonder >>> what it looks like in IE6?" So, join a group now. >>> >> I don't want to rain on your parade, but isn't that something a VM and the >> IE >> package from Tredosoft can do? Does browsercam do something that the >> regular >> IE instances can't do? When I test browser based apps at work I have one >> Windows VM and a Linux VM with all the popular and not so popular browsers >> including IE from version 3.0 up. That covers all rendering engines and >> about >> all OS (after all Mac OS X is just a window manager on top of BSD, but I >> also >> got a Mac for testing). I recently transferred those VMs from Workstation >> to >> Server 2.0 so that I can run it one a different box. And with the free >> TechNet >> accounts that Microsoft gives out I could even run the IEs natively on yet >> another set of VMs. >> >> David >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From oorza2k5 at gmail.com Wed Jun 3 21:55:05 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Wed, 3 Jun 2009 21:55:05 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <4A272837.4070509@marnik.net> References: <20090604002639386.RKFM6499@hrndva-omta03.mail.rr.com> <4A272837.4070509@marnik.net> Message-ID: <68de37340906031855oab1a79dmca45b27a6199a77c@mail.gmail.com> Ads? On the internet? I figured those went away now, haven't seen 'em in a while! On Wed, Jun 3, 2009 at 9:49 PM, Artur Marnik wrote: > > Hi Michele > > I really like what you are doing. Some tools are just to expensive for a > casual programmer/designer. > But if anyone is looking for a free tool take a look at: > http://browsershots.org/ it has some ads on the page but it does the job > done as well. > > Artur > > > > > > Michele Waldman wrote: > >> Don't work you aren't raining on my parade. It's more like a trail of >> tears >> for me. (If you don't know what a trail of tears is then you can Yahoo! >> It.) >> >> I've had problems with running virtual machines on my computer. The last >> time I tried it failed on me and I didn't have more time to look into it. >> >> Using this website saves me from having a ton of more software loaded on >> my >> one overloaded ancient pc. >> >> I don't need it extensively so it's a good solution for me. If I was >> doing >> more heavy css testing I might have to consider something else, but it >> fits >> my needs of periodic testing. If you have a group subscription then the >> price is nominal. >> >> Plus, I don't test one at a time. I select many browsers at once and in >> renders them all about 15 minutes later, while I'm doing something else. >> >> If there's a specific problem, then I can put my attention to it. >> >> Michele >> >> >>> -----Original Message----- >>> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >>> On Behalf Of David Krings >>> Sent: Wednesday, June 03, 2009 8:11 PM >>> To: NYPHP Talk >>> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability >>> >>> Michele Waldman wrote: >>> >>> >>>> on with the development. How many times have you thought, "I wonder >>>> what it looks like in IE6?" So, join a group now. >>>> >>>> >>> I don't want to rain on your parade, but isn't that something a VM and >>> the >>> IE >>> package from Tredosoft can do? Does browsercam do something that the >>> regular >>> IE instances can't do? When I test browser based apps at work I have one >>> Windows VM and a Linux VM with all the popular and not so popular >>> browsers >>> including IE from version 3.0 up. That covers all rendering engines and >>> about >>> all OS (after all Mac OS X is just a window manager on top of BSD, but I >>> also >>> got a Mac for testing). I recently transferred those VMs from Workstation >>> to >>> Server 2.0 so that I can run it one a different box. And with the free >>> TechNet >>> accounts that Microsoft gives out I could even run the IEs natively on >>> yet >>> another set of VMs. >>> >>> David >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >>> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> >> > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From artur at marnik.net Wed Jun 3 21:57:23 2009 From: artur at marnik.net (Artur Marnik) Date: Wed, 03 Jun 2009 21:57:23 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <007e01c9e4b6$93514f10$b9f3ed30$@com> References: <4A2710FD.4030602@gmx.net> <20090604002639386.RKFM6499@hrndva-omta03.mail.rr.com> <007e01c9e4b6$93514f10$b9f3ed30$@com> Message-ID: <4A272A03.2080707@marnik.net> Peter Sawczynec wrote: > Essentially: a) don't use any IE specific code; b) don't use any code > that does not run in IE; and c) especially important, don't use any code > that don?t run in IE Mac. Just not ever. Do something else. Use some > Flash gadget. If you don?t do a, b or c; all the code vets itself and > will be browser independent and automagically run on old browsers too > boot going way back. > So you suggest don't use: #some_div { width: 100px; padding: 2px; margin: 1px; } I don't see anything IE/Firefox/Opera/Chrome specific but check the results and some resource: http://www.ozzu.com/website-design-forum/firefox-interpret-css-padding-differently-t32917.html Cross browser compatibility has been a problem since they came up with netscape and IE and will never end. Artur From oorza2k5 at gmail.com Wed Jun 3 21:59:43 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Wed, 3 Jun 2009 21:59:43 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <4A272A03.2080707@marnik.net> References: <4A2710FD.4030602@gmx.net> <20090604002639386.RKFM6499@hrndva-omta03.mail.rr.com> <007e01c9e4b6$93514f10$b9f3ed30$@com> <4A272A03.2080707@marnik.net> Message-ID: <68de37340906031859o353a413cjc33c263662e34db5@mail.gmail.com> It'll end when Google succeeds in taking over the internet and we all use Chrome because Microsoft and Mozilla are dim memories that we tell our kids when we reminisce about the good ole e-days. 2009/6/3 Artur Marnik > Peter Sawczynec wrote: > >> Essentially: a) don't use any IE specific code; b) don't use any code >> that does not run in IE; and c) especially important, don't use any code >> that don?t run in IE Mac. Just not ever. Do something else. Use some >> Flash gadget. If you don?t do a, b or c; all the code vets itself and >> will be browser independent and automagically run on old browsers too >> boot going way back. >> > > So you suggest don't use: > #some_div { > width: 100px; > padding: 2px; > margin: 1px; > } > > I don't see anything IE/Firefox/Opera/Chrome specific but check the results > and some resource: > > http://www.ozzu.com/website-design-forum/firefox-interpret-css-padding-differently-t32917.html > > Cross browser compatibility has been a problem since they came up with > netscape and IE and will never end. > > > Artur > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Wed Jun 3 22:00:42 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 3 Jun 2009 22:00:42 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <007e01c9e4b6$93514f10$b9f3ed30$@com> Message-ID: <20090604020235167.ZIWG23263@hrndva-omta02.mail.rr.com> I do not write ie or ff specific css. As a matter of fact all of my css/html works on any browser once debugged. If you are writing specific browser code then your code is wrong. I could write a doc on tips for cross-browser css/html compatibility. Like using top and left instead of padding or margin. Javascript is an exception. There is necessity for browser specific, but that can be streamlined somewhat. But, to find all of your css/html bugs you have to test in all the browers. I've found Opera to be the best at finding bugs. But, every now and then something in my html/css crops up in IE6. It took me 3 months to figure out the right ways to code css/html without specifying browser and cut that slop out. Some doctypes seem to restrict javascript. I've found that to be a problem when the javascript in necessary. I need my javascript and html/css to all work. I like my php to work too. ;) Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Peter Sawczynec > Sent: Wednesday, June 03, 2009 9:49 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > This is just my exceptionally small irreverent dos centavos on this > topic. > > For about two years now, it seems one has been pretty much able to > develop almost anything desired using virtually any CSS and any > JavaScript (and using big heavy image files to boot) in 1000+ pixel wide > designs and its all good. > > And at this time, if one were to find that one needs to spend too much > hard time reviewing browser compatibility issues, then it is almost > axiomatic that the code itself is not sufficiently or democratically > "cross browser and platform independent" enough in the first place. > Essentially: a) don't use any IE specific code; b) don't use any code > that does not run in IE; and c) especially important, don't use any code > that don?t run in IE Mac. Just not ever. Do something else. Use some > Flash gadget. If you don?t do a, b or c; all the code vets itself and > will be browser independent and automagically run on old browsers too > boot going way back. > > Lastly, try to use XHTML "Transitional" to be easy on yourself > and all your friends. You'd be surprised how many "browser" > compatibility issues are actually and simply issues. "Strict" > breaks a lot of CSS and indirectly the JavaScript code. And that > heartache is simply not necessary. > > Then browser compatibility issues seem to just vanish. > > Warmest regards, > > Peter Sawczynec > Technology Dir. > bl?studio > 941.893.0396 > ps at blu-studio.com > www.blu-studio.com > > > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Michele Waldman > Sent: Wednesday, June 03, 2009 8:25 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > Don't work you aren't raining on my parade. It's more like a trail of > tears > for me. (If you don't know what a trail of tears is then you can Yahoo! > It.) > > I've had problems with running virtual machines on my computer. The > last > time I tried it failed on me and I didn't have more time to look into > it. > > Using this website saves me from having a ton of more software loaded on > my > one overloaded ancient pc. > > I don't need it extensively so it's a good solution for me. If I was > doing > more heavy css testing I might have to consider something else, but it > fits > my needs of periodic testing. If you have a group subscription then the > price is nominal. > > Plus, I don't test one at a time. I select many browsers at once and in > renders them all about 15 minutes later, while I'm doing something else. > > If there's a specific problem, then I can put my attention to it. > > Michele > > -----Original Message----- > > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] > > On Behalf Of David Krings > > Sent: Wednesday, June 03, 2009 8:11 PM > > To: NYPHP Talk > > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > > > Michele Waldman wrote: > > > on with the development. How many times have you thought, "I wonder > > > what it looks like in IE6?" So, join a group now. > > > > I don't want to rain on your parade, but isn't that something a VM and > the > > IE > > package from Tredosoft can do? Does browsercam do something that the > > regular > > IE instances can't do? When I test browser based apps at work I have > one > > Windows VM and a Linux VM with all the popular and not so popular > browsers > > including IE from version 3.0 up. That covers all rendering engines > and > > about > > all OS (after all Mac OS X is just a window manager on top of BSD, but > I > > also > > got a Mac for testing). I recently transferred those VMs from > Workstation > > to > > Server 2.0 so that I can run it one a different box. And with the free > > TechNet > > accounts that Microsoft gives out I could even run the IEs natively on > yet > > another set of VMs. > > > > David > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From mmwaldman at nyc.rr.com Wed Jun 3 22:03:02 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 3 Jun 2009 22:03:02 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <4A272837.4070509@marnik.net> Message-ID: <20090604020454891.ZHMO10427@hrndva-omta01.mail.rr.com> Browsershots restricts daily usage. I also paid for extended use of like $15. That money was out the window. I got nothing. I tried it. Then I joined browsercam. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Artur Marnik > Sent: Wednesday, June 03, 2009 9:50 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > > Hi Michele > > I really like what you are doing. Some tools are just to expensive for a > casual programmer/designer. > But if anyone is looking for a free tool take a look at: > http://browsershots.org/ it has some ads on the page but it does the job > done as well. > > Artur > > > > > Michele Waldman wrote: > > Don't work you aren't raining on my parade. It's more like a trail of > tears > > for me. (If you don't know what a trail of tears is then you can Yahoo! > > It.) > > > > I've had problems with running virtual machines on my computer. The > last > > time I tried it failed on me and I didn't have more time to look into > it. > > > > Using this website saves me from having a ton of more software loaded on > my > > one overloaded ancient pc. > > > > I don't need it extensively so it's a good solution for me. If I was > doing > > more heavy css testing I might have to consider something else, but it > fits > > my needs of periodic testing. If you have a group subscription then the > > price is nominal. > > > > Plus, I don't test one at a time. I select many browsers at once and in > > renders them all about 15 minutes later, while I'm doing something else. > > > > If there's a specific problem, then I can put my attention to it. > > > > Michele > > > >> -----Original Message----- > >> From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] > >> On Behalf Of David Krings > >> Sent: Wednesday, June 03, 2009 8:11 PM > >> To: NYPHP Talk > >> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > >> > >> Michele Waldman wrote: > >> > >>> on with the development. How many times have you thought, "I wonder > >>> what it looks like in IE6?" So, join a group now. > >>> > >> I don't want to rain on your parade, but isn't that something a VM and > the > >> IE > >> package from Tredosoft can do? Does browsercam do something that the > >> regular > >> IE instances can't do? When I test browser based apps at work I have > one > >> Windows VM and a Linux VM with all the popular and not so popular > browsers > >> including IE from version 3.0 up. That covers all rendering engines and > >> about > >> all OS (after all Mac OS X is just a window manager on top of BSD, but > I > >> also > >> got a Mac for testing). I recently transferred those VMs from > Workstation > >> to > >> Server 2.0 so that I can run it one a different box. And with the free > >> TechNet > >> accounts that Microsoft gives out I could even run the IEs natively on > yet > >> another set of VMs. > >> > >> David > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > >> > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From mmwaldman at nyc.rr.com Wed Jun 3 22:04:42 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 3 Jun 2009 22:04:42 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <4A272A03.2080707@marnik.net> Message-ID: <20090604020634612.ZNMQ23263@hrndva-omta02.mail.rr.com> I guarantee all of my css/html works on any browser when I'm finished without browser specific code. Uh, Oh. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Artur Marnik > Sent: Wednesday, June 03, 2009 9:57 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > Peter Sawczynec wrote: > > Essentially: a) don't use any IE specific code; b) don't use any code > > that does not run in IE; and c) especially important, don't use any code > > that don't run in IE Mac. Just not ever. Do something else. Use some > > Flash gadget. If you don't do a, b or c; all the code vets itself and > > will be browser independent and automagically run on old browsers too > > boot going way back. > > > > So you suggest don't use: > #some_div { > width: 100px; > padding: 2px; > margin: 1px; > } > > I don't see anything IE/Firefox/Opera/Chrome specific but check the > results > and some resource: > http://www.ozzu.com/website-design-forum/firefox-interpret-css-padding- > differently-t32917.html > > Cross browser compatibility has been a problem since they came up with > netscape and IE and will never end. > > > Artur > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From artur at marnik.net Wed Jun 3 22:08:41 2009 From: artur at marnik.net (Artur Marnik) Date: Wed, 03 Jun 2009 22:08:41 -0400 Subject: [nycphp-talk] web site testing Message-ID: <4A272CA9.4040709@marnik.net> Recently I found nice software to do QA on a web application. I find it very useful and it is free to use: http://seleniumhq.org/ Artur From consult at covenantedesign.com Wed Jun 3 22:22:56 2009 From: consult at covenantedesign.com (CED) Date: Wed, 03 Jun 2009 22:22:56 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090604020454891.ZHMO10427@hrndva-omta01.mail.rr.com> References: <20090604020454891.ZHMO10427@hrndva-omta01.mail.rr.com> Message-ID: <4A273000.5040101@covenantedesign.com> Michele Waldman wrote: > Browsershots restricts daily usage. I also paid for extended use of like > $15. That money was out the window. I got nothing. > > I tried it. Then I joined browsercam. > > Michele > > >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of Artur Marnik >> Sent: Wednesday, June 03, 2009 9:50 PM >> To: NYPHP Talk >> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability >> >> >> Hi Michele >> >> I really like what you are doing. Some tools are just to expensive for a >> casual programmer/designer. >> But if anyone is looking for a free tool take a look at: >> http://browsershots.org/ it has some ads on the page but it does the job >> done as well. >> >> Artur >> >> >> >> >> Michele Waldman wrote: >> >>> Don't work you aren't raining on my parade. It's more like a trail of >>> >> tears >> >>> for me. (If you don't know what a trail of tears is then you can Yahoo! >>> It.) >>> >>> I've had problems with running virtual machines on my computer. The >>> >> last >> >>> time I tried it failed on me and I didn't have more time to look into >>> >> it. >> >>> Using this website saves me from having a ton of more software loaded on >>> >> my >> >>> one overloaded ancient pc. >>> >>> I don't need it extensively so it's a good solution for me. If I was >>> >> doing >> >>> more heavy css testing I might have to consider something else, but it >>> >> fits >> >>> my needs of periodic testing. If you have a group subscription then the >>> price is nominal. >>> >>> Plus, I don't test one at a time. I select many browsers at once and in >>> renders them all about 15 minutes later, while I'm doing something else. >>> >>> If there's a specific problem, then I can put my attention to it. >>> >>> Michele >>> >>> >>>> -----Original Message----- >>>> From: talk-bounces at lists.nyphp.org [mailto:talk- >>>> >> bounces at lists.nyphp.org] >> >>>> On Behalf Of David Krings >>>> Sent: Wednesday, June 03, 2009 8:11 PM >>>> To: NYPHP Talk >>>> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability >>>> >>>> Michele Waldman wrote: >>>> >>>> >>>>> on with the development. How many times have you thought, "I wonder >>>>> what it looks like in IE6?" So, join a group now. >>>>> >>>>> >>>> I don't want to rain on your parade, but isn't that something a VM and >>>> >> the >> >>>> IE >>>> package from Tredosoft can do? Does browsercam do something that the >>>> regular >>>> IE instances can't do? When I test browser based apps at work I have >>>> >> one >> >>>> Windows VM and a Linux VM with all the popular and not so popular >>>> >> browsers >> >>>> including IE from version 3.0 up. That covers all rendering engines and >>>> about >>>> all OS (after all Mac OS X is just a window manager on top of BSD, but >>>> >> I >> >>>> also >>>> got a Mac for testing). I recently transferred those VMs from >>>> >> Workstation >> >>>> to >>>> Server 2.0 so that I can run it one a different box. And with the free >>>> TechNet >>>> accounts that Microsoft gives out I could even run the IEs natively on >>>> >> yet >> >>>> another set of VMs. >>>> >>>> David >>>> _______________________________________________ >>>> New York PHP User Group Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> http://www.nyphp.org/show_participation.php >>>> >>>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >>> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > > But you can run browsershots yourself. Great Post Artur, my CentOS box will be running this in the next ten minutes! From mmwaldman at nyc.rr.com Wed Jun 3 22:34:15 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 3 Jun 2009 22:34:15 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <4A272837.4070509@marnik.net> Message-ID: <20090604023607352.LSY10427@hrndva-omta01.mail.rr.com> Besides, we are talking $50/year, even that is affordable to the casual designer/programmer. That's why you join a group and not by yourself. M* > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Artur Marnik > Sent: Wednesday, June 03, 2009 9:50 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > > Hi Michele > > I really like what you are doing. Some tools are just to expensive for a > casual programmer/designer. > But if anyone is looking for a free tool take a look at: > http://browsershots.org/ it has some ads on the page but it does the job > done as well. > > Artur > > > > > Michele Waldman wrote: > > Don't work you aren't raining on my parade. It's more like a trail of > tears > > for me. (If you don't know what a trail of tears is then you can Yahoo! > > It.) > > > > I've had problems with running virtual machines on my computer. The > last > > time I tried it failed on me and I didn't have more time to look into > it. > > > > Using this website saves me from having a ton of more software loaded on > my > > one overloaded ancient pc. > > > > I don't need it extensively so it's a good solution for me. If I was > doing > > more heavy css testing I might have to consider something else, but it > fits > > my needs of periodic testing. If you have a group subscription then the > > price is nominal. > > > > Plus, I don't test one at a time. I select many browsers at once and in > > renders them all about 15 minutes later, while I'm doing something else. > > > > If there's a specific problem, then I can put my attention to it. > > > > Michele > > > >> -----Original Message----- > >> From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] > >> On Behalf Of David Krings > >> Sent: Wednesday, June 03, 2009 8:11 PM > >> To: NYPHP Talk > >> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > >> > >> Michele Waldman wrote: > >> > >>> on with the development. How many times have you thought, "I wonder > >>> what it looks like in IE6?" So, join a group now. > >>> > >> I don't want to rain on your parade, but isn't that something a VM and > the > >> IE > >> package from Tredosoft can do? Does browsercam do something that the > >> regular > >> IE instances can't do? When I test browser based apps at work I have > one > >> Windows VM and a Linux VM with all the popular and not so popular > browsers > >> including IE from version 3.0 up. That covers all rendering engines and > >> about > >> all OS (after all Mac OS X is just a window manager on top of BSD, but > I > >> also > >> got a Mac for testing). I recently transferred those VMs from > Workstation > >> to > >> Server 2.0 so that I can run it one a different box. And with the free > >> TechNet > >> accounts that Microsoft gives out I could even run the IEs natively on > yet > >> another set of VMs. > >> > >> David > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > >> > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From ps at blu-studio.com Wed Jun 3 22:39:14 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Wed, 3 Jun 2009 22:39:14 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090604020634612.ZNMQ23263@hrndva-omta02.mail.rr.com> References: <4A272A03.2080707@marnik.net> <20090604020634612.ZNMQ23263@hrndva-omta02.mail.rr.com> Message-ID: <008b01c9e4bd$a70033d0$f5009b70$@com> Now, me I don't guarantee anything (especially not in writing), but I do use words such as code is "targeted for assured compatibility with" blah blah. As far as I can tell, speaking with one handy broad paint stroke, as long as the JavaScript code in question is always addressing everything in the DOM via the general and proper "getElementById()" method including XML=like child elements (and nothing in any older style), then this JavaScript code is current, correct and sufficiently "cross browser, platform independent" to work in all relevant and widely-distributed browsers. If this type of modern democratic ECMAScript breaks in any old browser, then it is very likely that that browser is TOO old and is likely a security hazard to code down to in this day and age. And so I wouldn't bother to do that and I would tell the client so. And that gets the "old browser compatibility" albatross off the table too. Yeah, nice. And so once again, I find that Opera, IE, Safari and FF can all play ball just by coding to clean modern standards. I don't use layouts that stretch to 100% page width. That is a CSS control nightmare. I make one master relatively positioned outer div container of a fixed width of 900 - 1100 px and then every other div is an absolutely positioned child div inside the master div. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michele Waldman Sent: Wednesday, June 03, 2009 10:05 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability I guarantee all of my css/html works on any browser when I'm finished without browser specific code. Uh, Oh. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Artur Marnik > Sent: Wednesday, June 03, 2009 9:57 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > Peter Sawczynec wrote: > > Essentially: a) don't use any IE specific code; b) don't use any code > > that does not run in IE; and c) especially important, don't use any code > > that don't run in IE Mac. Just not ever. Do something else. Use some > > Flash gadget. If you don't do a, b or c; all the code vets itself and > > will be browser independent and automagically run on old browsers too > > boot going way back. > > > > So you suggest don't use: > #some_div { > width: 100px; > padding: 2px; > margin: 1px; > } > > I don't see anything IE/Firefox/Opera/Chrome specific but check the > results > and some resource: > http://www.ozzu.com/website-design-forum/firefox-interpret-css-padding- > differently-t32917.html > > Cross browser compatibility has been a problem since they came up with > netscape and IE and will never end. > > > Artur > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From mmwaldman at nyc.rr.com Wed Jun 3 22:39:48 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 3 Jun 2009 22:39:48 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <4A273000.5040101@covenantedesign.com> Message-ID: <20090604024140900.WWQC6499@hrndva-omta03.mail.rr.com> What does this mean: "But you can run browsershots yourself. Great Post Artur, my CentOS box will be running this in the next ten minutes!" Browsershots would not let me run more more than say every 1/2 an hour. How can you debug a website like that. What do you tell your client? I'm billing you for all of the half hours while I wait for browershots to run again because I don't want to pay a $50 annual fee for a non restrictive tool? Browsershots will not let your run more than like every half an hour or so. I don't remember exactly, but I followed someone's suggestion tried browsershots and I was sorry. Join my group or not. I really don't care. I'm paying for a subscription either way. Margaret Michele Waldman Sovereign Sites L.L.C. Website Development 646-861-3375 Rule your domain ... > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of CED > Sent: Wednesday, June 03, 2009 10:23 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > Michele Waldman wrote: > > Browsershots restricts daily usage. I also paid for extended use of > like > > $15. That money was out the window. I got nothing. > > > > I tried it. Then I joined browsercam. > > > > Michele > > > > > >> -----Original Message----- > >> From: talk-bounces at lists.nyphp.org [mailto:talk- > bounces at lists.nyphp.org] > >> On Behalf Of Artur Marnik > >> Sent: Wednesday, June 03, 2009 9:50 PM > >> To: NYPHP Talk > >> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > >> > >> > >> Hi Michele > >> > >> I really like what you are doing. Some tools are just to expensive for > a > >> casual programmer/designer. > >> But if anyone is looking for a free tool take a look at: > >> http://browsershots.org/ it has some ads on the page but it does the > job > >> done as well. > >> > >> Artur > >> > >> > >> > >> > >> Michele Waldman wrote: > >> > >>> Don't work you aren't raining on my parade. It's more like a trail of > >>> > >> tears > >> > >>> for me. (If you don't know what a trail of tears is then you can > Yahoo! > >>> It.) > >>> > >>> I've had problems with running virtual machines on my computer. The > >>> > >> last > >> > >>> time I tried it failed on me and I didn't have more time to look into > >>> > >> it. > >> > >>> Using this website saves me from having a ton of more software loaded > on > >>> > >> my > >> > >>> one overloaded ancient pc. > >>> > >>> I don't need it extensively so it's a good solution for me. If I was > >>> > >> doing > >> > >>> more heavy css testing I might have to consider something else, but it > >>> > >> fits > >> > >>> my needs of periodic testing. If you have a group subscription then > the > >>> price is nominal. > >>> > >>> Plus, I don't test one at a time. I select many browsers at once and > in > >>> renders them all about 15 minutes later, while I'm doing something > else. > >>> > >>> If there's a specific problem, then I can put my attention to it. > >>> > >>> Michele > >>> > >>> > >>>> -----Original Message----- > >>>> From: talk-bounces at lists.nyphp.org [mailto:talk- > >>>> > >> bounces at lists.nyphp.org] > >> > >>>> On Behalf Of David Krings > >>>> Sent: Wednesday, June 03, 2009 8:11 PM > >>>> To: NYPHP Talk > >>>> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > >>>> > >>>> Michele Waldman wrote: > >>>> > >>>> > >>>>> on with the development. How many times have you thought, "I wonder > >>>>> what it looks like in IE6?" So, join a group now. > >>>>> > >>>>> > >>>> I don't want to rain on your parade, but isn't that something a VM > and > >>>> > >> the > >> > >>>> IE > >>>> package from Tredosoft can do? Does browsercam do something that the > >>>> regular > >>>> IE instances can't do? When I test browser based apps at work I have > >>>> > >> one > >> > >>>> Windows VM and a Linux VM with all the popular and not so popular > >>>> > >> browsers > >> > >>>> including IE from version 3.0 up. That covers all rendering engines > and > >>>> about > >>>> all OS (after all Mac OS X is just a window manager on top of BSD, > but > >>>> > >> I > >> > >>>> also > >>>> got a Mac for testing). I recently transferred those VMs from > >>>> > >> Workstation > >> > >>>> to > >>>> Server 2.0 so that I can run it one a different box. And with the > free > >>>> TechNet > >>>> accounts that Microsoft gives out I could even run the IEs natively > on > >>>> > >> yet > >> > >>>> another set of VMs. > >>>> > >>>> David > >>>> _______________________________________________ > >>>> New York PHP User Group Community Talk Mailing List > >>>> http://lists.nyphp.org/mailman/listinfo/talk > >>>> > >>>> http://www.nyphp.org/show_participation.php > >>>> > >>>> > >>> _______________________________________________ > >>> New York PHP User Group Community Talk Mailing List > >>> http://lists.nyphp.org/mailman/listinfo/talk > >>> > >>> http://www.nyphp.org/show_participation.php > >>> > >>> > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > >> > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > > > > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From ps at blu-studio.com Wed Jun 3 22:50:50 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Wed, 3 Jun 2009 22:50:50 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <008b01c9e4bd$a70033d0$f5009b70$@com> References: <4A272A03.2080707@marnik.net> <20090604020634612.ZNMQ23263@hrndva-omta02.mail.rr.com> <008b01c9e4bd$a70033d0$f5009b70$@com> Message-ID: <008c01c9e4bf$4604dca0$d20e95e0$@com> One closing thought: I think in the analysis of the importance of "browser compatibility" issue(s), it would be better that we get unfocused from the "older" browser compatibility issue and bury that and get freshly focused more on whether our websites are compatible with iPhones and Smartphones and other tiny devices instead. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Peter Sawczynec Sent: Wednesday, June 03, 2009 10:39 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability Now, me I don't guarantee anything (especially not in writing), but I do use words such as code is "targeted for assured compatibility with" blah blah. As far as I can tell, speaking with one handy broad paint stroke, as long as the JavaScript code in question is always addressing everything in the DOM via the general and proper "getElementById()" method including XML=like child elements (and nothing in any older style), then this JavaScript code is current, correct and sufficiently "cross browser, platform independent" to work in all relevant and widely-distributed browsers. If this type of modern democratic ECMAScript breaks in any old browser, then it is very likely that that browser is TOO old and is likely a security hazard to code down to in this day and age. And so I wouldn't bother to do that and I would tell the client so. And that gets the "old browser compatibility" albatross off the table too. Yeah, nice. And so once again, I find that Opera, IE, Safari and FF can all play ball just by coding to clean modern standards. I don't use layouts that stretch to 100% page width. That is a CSS control nightmare. I make one master relatively positioned outer div container of a fixed width of 900 - 1100 px and then every other div is an absolutely positioned child div inside the master div. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michele Waldman Sent: Wednesday, June 03, 2009 10:05 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability I guarantee all of my css/html works on any browser when I'm finished without browser specific code. Uh, Oh. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Artur Marnik > Sent: Wednesday, June 03, 2009 9:57 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability > > Peter Sawczynec wrote: > > Essentially: a) don't use any IE specific code; b) don't use any code > > that does not run in IE; and c) especially important, don't use any code > > that don't run in IE Mac. Just not ever. Do something else. Use some > > Flash gadget. If you don't do a, b or c; all the code vets itself and > > will be browser independent and automagically run on old browsers too > > boot going way back. > > > > So you suggest don't use: > #some_div { > width: 100px; > padding: 2px; > margin: 1px; > } > > I don't see anything IE/Firefox/Opera/Chrome specific but check the > results > and some resource: > http://www.ozzu.com/website-design-forum/firefox-interpret-css-padding- > differently-t32917.html > > Cross browser compatibility has been a problem since they came up with > netscape and IE and will never end. > > > Artur > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From consult at covenantedesign.com Wed Jun 3 23:13:00 2009 From: consult at covenantedesign.com (CED) Date: Wed, 03 Jun 2009 23:13:00 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090604024140900.WWQC6499@hrndva-omta03.mail.rr.com> References: <20090604024140900.WWQC6499@hrndva-omta03.mail.rr.com> Message-ID: <4A273BBC.9020305@covenantedesign.com> Michele Waldman wrote: > What does this mean: > "But you can run browsershots yourself. > > Great Post Artur, my CentOS box will be running this in the next ten > minutes!" > > Browsershots would not let me run more more than say every 1/2 an hour. How > can you debug a website like that. What do you tell your client? I'm > billing you for all of the half hours while I wait for browershots to run > again because I don't want to pay a $50 annual fee for a non restrictive > tool? > > Browsershots will not let your run more than like every half an hour or so. > I don't remember exactly, but I followed someone's suggestion tried > browsershots and I was sorry. > > Join my group or not. I really don't care. I'm paying for a subscription > either way. > > Margaret Michele Waldman > Sovereign Sites L.L.C. > Website Development > 646-861-3375 > Rule your domain ... > > >> -----Original Message----- >> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] >> On Behalf Of CED >> Sent: Wednesday, June 03, 2009 10:23 PM >> To: NYPHP Talk >> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability >> >> Michele Waldman wrote: >> >>> Browsershots restricts daily usage. I also paid for extended use of >>> >> like >> >>> $15. That money was out the window. I got nothing. >>> >>> I tried it. Then I joined browsercam. >>> >>> Michele >>> >>> >>> >>>> -----Original Message----- >>>> From: talk-bounces at lists.nyphp.org [mailto:talk- >>>> >> bounces at lists.nyphp.org] >> >>>> On Behalf Of Artur Marnik >>>> Sent: Wednesday, June 03, 2009 9:50 PM >>>> To: NYPHP Talk >>>> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability >>>> >>>> >>>> Hi Michele >>>> >>>> I really like what you are doing. Some tools are just to expensive for >>>> >> a >> >>>> casual programmer/designer. >>>> But if anyone is looking for a free tool take a look at: >>>> http://browsershots.org/ it has some ads on the page but it does the >>>> >> job >> >>>> done as well. >>>> >>>> Artur >>>> >>>> >>>> >>>> >>>> Michele Waldman wrote: >>>> >>>> >>>>> Don't work you aren't raining on my parade. It's more like a trail of >>>>> >>>>> >>>> tears >>>> >>>> >>>>> for me. (If you don't know what a trail of tears is then you can >>>>> >> Yahoo! >> >>>>> It.) >>>>> >>>>> I've had problems with running virtual machines on my computer. The >>>>> >>>>> >>>> last >>>> >>>> >>>>> time I tried it failed on me and I didn't have more time to look into >>>>> >>>>> >>>> it. >>>> >>>> >>>>> Using this website saves me from having a ton of more software loaded >>>>> >> on >> >>>> my >>>> >>>> >>>>> one overloaded ancient pc. >>>>> >>>>> I don't need it extensively so it's a good solution for me. If I was >>>>> >>>>> >>>> doing >>>> >>>> >>>>> more heavy css testing I might have to consider something else, but it >>>>> >>>>> >>>> fits >>>> >>>> >>>>> my needs of periodic testing. If you have a group subscription then >>>>> >> the >> >>>>> price is nominal. >>>>> >>>>> Plus, I don't test one at a time. I select many browsers at once and >>>>> >> in >> >>>>> renders them all about 15 minutes later, while I'm doing something >>>>> >> else. >> >>>>> If there's a specific problem, then I can put my attention to it. >>>>> >>>>> Michele >>>>> >>>>> >>>>> >>>>>> -----Original Message----- >>>>>> From: talk-bounces at lists.nyphp.org [mailto:talk- >>>>>> >>>>>> >>>> bounces at lists.nyphp.org] >>>> >>>> >>>>>> On Behalf Of David Krings >>>>>> Sent: Wednesday, June 03, 2009 8:11 PM >>>>>> To: NYPHP Talk >>>>>> Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability >>>>>> >>>>>> Michele Waldman wrote: >>>>>> >>>>>> >>>>>> >>>>>>> on with the development. How many times have you thought, "I wonder >>>>>>> what it looks like in IE6?" So, join a group now. >>>>>>> >>>>>>> >>>>>>> >>>>>> I don't want to rain on your parade, but isn't that something a VM >>>>>> >> and >> >>>> the >>>> >>>> >>>>>> IE >>>>>> package from Tredosoft can do? Does browsercam do something that the >>>>>> regular >>>>>> IE instances can't do? When I test browser based apps at work I have >>>>>> >>>>>> >>>> one >>>> >>>> >>>>>> Windows VM and a Linux VM with all the popular and not so popular >>>>>> >>>>>> >>>> browsers >>>> >>>> >>>>>> including IE from version 3.0 up. That covers all rendering engines >>>>>> >> and >> >>>>>> about >>>>>> all OS (after all Mac OS X is just a window manager on top of BSD, >>>>>> >> but >> >>>> I >>>> >>>> >>>>>> also >>>>>> got a Mac for testing). I recently transferred those VMs from >>>>>> >>>>>> >>>> Workstation >>>> >>>> >>>>>> to >>>>>> Server 2.0 so that I can run it one a different box. And with the >>>>>> >> free >> >>>>>> TechNet >>>>>> accounts that Microsoft gives out I could even run the IEs natively >>>>>> >> on >> >>>> yet >>>> >>>> >>>>>> another set of VMs. >>>>>> >>>>>> David >>>>>> _______________________________________________ >>>>>> New York PHP User Group Community Talk Mailing List >>>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>>> >>>>>> http://www.nyphp.org/show_participation.php >>>>>> >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> New York PHP User Group Community Talk Mailing List >>>>> http://lists.nyphp.org/mailman/listinfo/talk >>>>> >>>>> http://www.nyphp.org/show_participation.php >>>>> >>>>> >>>>> >>>> _______________________________________________ >>>> New York PHP User Group Community Talk Mailing List >>>> http://lists.nyphp.org/mailman/listinfo/talk >>>> >>>> http://www.nyphp.org/show_participation.php >>>> >>>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php >>> >>> >>> >>> >>> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > > What does it mean? Oh Michele, how I've missed reading your emails... http://tinyurl.com/qngrlr http://trac.browsershots.org/ http://trac.browsershots.org/wiki/RequirementsForServer http://trac.browsershots.org/wiki/RequirementsForFactories From hans at cyberxdesigns.com Thu Jun 4 08:05:10 2009 From: hans at cyberxdesigns.com (Hans C. Kaspersetz) Date: Thu, 4 Jun 2009 08:05:10 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <008c01c9e4bf$4604dca0$d20e95e0$@com> Message-ID: <20090604120511.1CE901CB2533@lists.nyphp.org> -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Peter Sawczynec Sent: Wednesday, June 03, 2009 10:39 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability Now, me I don't guarantee anything (especially not in writing), but I do use words such as code is "targeted for assured compatibility with" blah blah. As far as I can tell, speaking with one handy broad paint stroke, as long as the JavaScript code in question is always addressing everything in the DOM via the general and proper "getElementById()" method including XML=like child elements (and nothing in any older style), then this JavaScript code is current, correct and sufficiently "cross browser, platform independent" to work in all relevant and widely-distributed browsers. If this type of modern democratic ECMAScript breaks in any old browser, then it is very likely that that browser is TOO old and is likely a security hazard to code down to in this day and age. And so I wouldn't bother to do that and I would tell the client so. And that gets the "old browser compatibility" albatross off the table too. Yeah, nice. And so once again, I find that Opera, IE, Safari and FF can all play ball just by coding to clean modern standards. I don't use layouts that stretch to 100% page width. That is a CSS control nightmare. I make one master relatively positioned outer div container of a fixed width of 900 - 1100 px and then every other div is an absolutely positioned child div inside the master div. --- New Message -- First, we might want to take this over to the front-end list. I am cross posting this to that list so the discussion can continue on the relevant list. I can imagine there are some people rolling their eyes right now. Second, how are you handling your CSS menus with no browser specific coding? I would love to see some examples. I know I haven't found a way without some browser specific coding and CSS. Hans K From ps at blu-studio.com Thu Jun 4 09:25:13 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 4 Jun 2009 09:25:13 -0400 Subject: [nycphp-talk] Periodic Browsercam.com group availability In-Reply-To: <20090604120511.1CE901CB2533@lists.nyphp.org> References: <008c01c9e4bf$4604dca0$d20e95e0$@com> <20090604120511.1CE901CB2533@lists.nyphp.org> Message-ID: <002101c9e517$e537aed0$afa70c70$@com> You know, I'm not even on the frontend list. I missed that. CSS/PHP MENU This URL: http://www.giba.us ...is a simple but elegant PHP website I designed and built that has an example of a very simple CSS one-level menu that also uses PHP to grab the page name out of the URL request and changes the CSS class on that matching menu item from "regular" to "hot". The web pages are named literally: webcams.php or tolls.php to match the CSS menu titles and CSS style names too. JQUERY This URL: http://www.capehazeinsider.com ...is also a bigger busier PHP website that I designed and built and this site uses jquery on literally every page for: image effects, show/hide/glide divs, manage external links, create popup overlays, page scrolling, tabbed content... I highly recommend the jquery code products which are just awesome and have super high degree of "cross browser" compatibility. I even hauled out the jquery big guns to create one single show/hide div effect in the Tolls section of the above noted GIBA website. I have two websites in development now that will use jquery for quite nice image effects and content scrolling. ___________________________ I don?t believe that I am using any browser specific code just generic things like: border-left, padding-bottom, margin, width and z-index. But you know I do use some more rare CSS like: line-height, letter-spacing and white-space; and well they work quite accurately in so many browsers that I use them all the time. There are so many high quality CSS multi-level menus already online that are made from nothing but nested ordered lists and styled with some tasty but very generic CSS. You can start at www.alistapart.com Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Hans C. Kaspersetz Sent: Thursday, June 04, 2009 8:05 AM To: 'NYPHP Talk'; front-end at lists.nyphp.org Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Peter Sawczynec Sent: Wednesday, June 03, 2009 10:39 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Periodic Browsercam.com group availability Now, me I don't guarantee anything (especially not in writing), but I do use words such as code is "targeted for assured compatibility with" blah blah. As far as I can tell, speaking with one handy broad paint stroke, as long as the JavaScript code in question is always addressing everything in the DOM via the general and proper "getElementById()" method including XML=like child elements (and nothing in any older style), then this JavaScript code is current, correct and sufficiently "cross browser, platform independent" to work in all relevant and widely-distributed browsers. If this type of modern democratic ECMAScript breaks in any old browser, then it is very likely that that browser is TOO old and is likely a security hazard to code down to in this day and age. And so I wouldn't bother to do that and I would tell the client so. And that gets the "old browser compatibility" albatross off the table too. Yeah, nice. And so once again, I find that Opera, IE, Safari and FF can all play ball just by coding to clean modern standards. I don't use layouts that stretch to 100% page width. That is a CSS control nightmare. I make one master relatively positioned outer div container of a fixed width of 900 - 1100 px and then every other div is an absolutely positioned child div inside the master div. --- New Message -- First, we might want to take this over to the front-end list. I am cross posting this to that list so the discussion can continue on the relevant list. I can imagine there are some people rolling their eyes right now. Second, how are you handling your CSS menus with no browser specific coding? I would love to see some examples. I know I haven't found a way without some browser specific coding and CSS. Hans K _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From ajai at bitblit.net Thu Jun 4 11:02:13 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 4 Jun 2009 11:02:13 -0400 (EDT) Subject: [nycphp-talk] web site testing In-Reply-To: <4A272CA9.4040709@marnik.net> Message-ID: On Wed, 3 Jun 2009, Artur Marnik wrote: > Recently I found nice software to do QA on a web application. > I find it very useful and it is free to use: > http://seleniumhq.org/ http://www.opensourcetesting.org/functional.php -- Aj. From rahmin at insite-out.com Thu Jun 4 11:48:40 2009 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Thu, 4 Jun 2009 11:48:40 -0400 Subject: [nycphp-talk] memory problems In-Reply-To: <002101c9e517$e537aed0$afa70c70$@com> References: <008c01c9e4bf$4604dca0$d20e95e0$@com> <20090604120511.1CE901CB2533@lists.nyphp.org> <002101c9e517$e537aed0$afa70c70$@com> Message-ID: <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> Heya, So, I have this script that does the following: 1. Requests jpeg from origin CDN via cURL 2. If file doesnt exist... log error, continue. 3. Write jpeg to temp file 4. Resize original image (GD lib) to temp file. FTP to directory on new CDN. Create directory structure if not present. Repeat seven times per image. Not sure how many, but we're talking about 10k; maybe 15k images. The script works, but problem we're running into is the memory limit. We got about 31% through the images, and hit: PHP Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 41760 bytes) in /web/lib/php/populate_images.php on line 135 Maybe it's me, but if we have to allot more than 500 MB of memory, something is wrong. Any ideas? Maybe sleep the script after each image? We're running the script in shell. From dorgan at donaldorgan.com Thu Jun 4 12:00:27 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Thu, 4 Jun 2009 12:00:27 -0400 (EDT) Subject: [nycphp-talk] memory problems In-Reply-To: <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> Message-ID: <14469483.9141244131227336.JavaMail.root@twoguyshosting.com.> Do you mind sharing the script? ----- Original Message ----- From: "Rahmin Pavlovic" To: "NYPHP Talk" Sent: Thursday, June 4, 2009 11:48:40 AM Subject: [nycphp-talk] memory problems Heya, So, I have this script that does the following: 1. Requests jpeg from origin CDN via cURL 2. If file doesnt exist... log error, continue. 3. Write jpeg to temp file 4. Resize original image (GD lib) to temp file. FTP to directory on new CDN. Create directory structure if not present. Repeat seven times per image. Not sure how many, but we're talking about 10k; maybe 15k images. The script works, but problem we're running into is the memory limit. We got about 31% through the images, and hit: PHP Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 41760 bytes) in /web/lib/php/populate_images.php on line 135 Maybe it's me, but if we have to allot more than 500 MB of memory, something is wrong. Any ideas? Maybe sleep the script after each image? We're running the script in shell. _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From rmarscher at beaffinitive.com Thu Jun 4 12:12:54 2009 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 4 Jun 2009 11:12:54 -0500 Subject: [nycphp-talk] memory problems In-Reply-To: <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> References: <008c01c9e4bf$4604dca0$d20e95e0$@com> <20090604120511.1CE901CB2533@lists.nyphp.org> <002101c9e517$e537aed0$afa70c70$@com> <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> Message-ID: <71377399-2A35-42F3-9770-795163F6A936@beaffinitive.com> GD needs to operate on raw data so even if the jpegs are smaller than your 500mb limit, when it expands it, it will go over. A couple ideas... exec ImageMagick convert instead of using GD for the resize. On Jun 4, 2009, at 10:48 AM, Rahmin Pavlovic wrote: > Heya, > > So, I have this script that does the following: > > 1. Requests jpeg from origin CDN via cURL > 2. If file doesnt exist... log error, continue. > 3. Write jpeg to temp file > 4. Resize original image (GD lib) to temp file. FTP to directory on > new CDN. Create directory structure if not present. Repeat seven > times per image. > > Not sure how many, but we're talking about 10k; maybe 15k images. > > The script works, but problem we're running into is the memory > limit. We got about 31% through the images, and hit: > > PHP Fatal error: Allowed memory size of 524288000 bytes exhausted > (tried to allocate 41760 bytes) in /web/lib/php/populate_images.php > on line 135 > > Maybe it's me, but if we have to allot more than 500 MB of memory, > something is wrong. > > Any ideas? Maybe sleep the script after each image? > > We're running the script in shell. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From rmarscher at beaffinitive.com Thu Jun 4 12:25:45 2009 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 4 Jun 2009 11:25:45 -0500 Subject: [nycphp-talk] memory problems In-Reply-To: <71377399-2A35-42F3-9770-795163F6A936@beaffinitive.com> References: <008c01c9e4bf$4604dca0$d20e95e0$@com> <20090604120511.1CE901CB2533@lists.nyphp.org> <002101c9e517$e537aed0$afa70c70$@com> <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> <71377399-2A35-42F3-9770-795163F6A936@beaffinitive.com> Message-ID: <20A4C52A-7497-4E3D-80FE-4226CA21056F@beaffinitive.com> Sorry guys. iPhone prematurely sent that. The other idea is to buffer the download of the file. You can use fopen/fread/fclose to make sure you only keep say 1mb of data in php's memory while you download the file. Usually urls can be treated like files via php's url file wrappers unless those have been disabled. Or you can just ini_set('memory_limit', '1500m'); Or however much memory you have available for the script and see if you can get by. Really though, there's no reason a script like this needs to use so much memory. Sometimes when running batch scripts, i've seen memory usage continue to rise through the iterations for unknown reasons. In that case, I split the script so there's a master script that manages the queue and another script that I exec to run the operation. That way it's a separate process and memory is always cleaned up. Good luck, Rob On Jun 4, 2009, at 11:12 AM, Rob Marscher wrote: > GD needs to operate on raw data so even if the jpegs are smaller > than your 500mb limit, when it expands it, it will go over. > > A couple ideas... exec ImageMagick convert instead of using GD for > the resize. > > On Jun 4, 2009, at 10:48 AM, Rahmin Pavlovic > wrote: > >> Heya, >> >> So, I have this script that does the following: >> >> 1. Requests jpeg from origin CDN via cURL >> 2. If file doesnt exist... log error, continue. >> 3. Write jpeg to temp file >> 4. Resize original image (GD lib) to temp file. FTP to directory >> on new CDN. Create directory structure if not present. Repeat >> seven times per image. >> >> Not sure how many, but we're talking about 10k; maybe 15k images. >> >> The script works, but problem we're running into is the memory >> limit. We got about 31% through the images, and hit: >> >> PHP Fatal error: Allowed memory size of 524288000 bytes exhausted >> (tried to allocate 41760 bytes) in /web/lib/php/populate_images.php >> on line 135 >> >> Maybe it's me, but if we have to allot more than 500 MB of memory, >> something is wrong. >> >> Any ideas? Maybe sleep the script after each image? >> >> We're running the script in shell. >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php From brenttech at gmail.com Thu Jun 4 12:29:22 2009 From: brenttech at gmail.com (Brent Baisley) Date: Thu, 4 Jun 2009 12:29:22 -0400 Subject: [nycphp-talk] memory problems In-Reply-To: <14469483.9141244131227336.JavaMail.root@twoguyshosting.com.> References: <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> <14469483.9141244131227336.JavaMail.root@twoguyshosting.com.> Message-ID: <5d515c620906040929l9c6c6e1md44d5ca669bc7f59@mail.gmail.com> You are not releasing memory somewhere. Using sleep is not going to help in clearing memory. Monitor your memory usage (memory_get_usage) and see if your memory usage keeps climbing or if it's just 1 big image that is causing the problem. Alternatively, fork your script for each image if you are running it from the command line, and on unix. $maxForks = 20; while ( $files2process ) { $processFile = getNextFileURL(); for ( $i=0; $i<$maxForks; $i++ ) { $pid = pcntl_fork(); if ($pid == -1) { die('could not fork'); } else if ($pid) { // we are the parent $childPIDs[] = $pid; } else { ...process file... exit(); } // Wait for all the children to finish foreach($childPIDs as $pid) { pcntl_waitpid($pid, $status); echo '*** '.$pid. " ENDED\n"; } } Then a single image won't stop the whole process, the one image will just cause one child process to exit. This would also speed things up considerably since you can process multiple images at once. There are obviously holes in the script, but they should be easy to fill. Be aware that the system you are on may not have forking enabled. In which case, forget my whole response. Brent Baisley On Thu, Jun 4, 2009 at 12:00 PM, Donald J. Organ IV wrote: > Do you mind sharing the script? > > > ----- Original Message ----- > From: "Rahmin Pavlovic" > To: "NYPHP Talk" > Sent: Thursday, June 4, 2009 11:48:40 AM > Subject: [nycphp-talk] memory problems > > Heya, > > So, I have this script that does the following: > > 1. ?Requests jpeg from origin CDN via cURL > 2. ?If file doesnt exist... log error, continue. > 3. ?Write jpeg to temp file > 4. ?Resize original image (GD lib) to temp file. FTP to directory on > new CDN. ?Create directory structure if not present. ?Repeat seven > times per image. > > Not sure how many, but we're talking about 10k; maybe 15k images. > > The script works, but problem we're running into is the memory limit. > We got about 31% through the images, and hit: > > PHP Fatal error: Allowed memory size of 524288000 bytes exhausted > (tried to allocate 41760 bytes) in /web/lib/php/populate_images.php on > line 135 > > Maybe it's me, but if we have to allot more than 500 MB of memory, > something is wrong. > > Any ideas? ?Maybe sleep the script after each image? > > We're running the script in shell. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From rmarscher at beaffinitive.com Thu Jun 4 12:29:36 2009 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Thu, 4 Jun 2009 11:29:36 -0500 Subject: [nycphp-talk] memory problems In-Reply-To: <20A4C52A-7497-4E3D-80FE-4226CA21056F@beaffinitive.com> References: <008c01c9e4bf$4604dca0$d20e95e0$@com> <20090604120511.1CE901CB2533@lists.nyphp.org> <002101c9e517$e537aed0$afa70c70$@com> <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> <71377399-2A35-42F3-9770-795163F6A936@beaffinitive.com> <20A4C52A-7497-4E3D-80FE-4226CA21056F@beaffinitive.com> Message-ID: <48E54D3E-263D-4A03-A353-0E18EC93F58D@beaffinitive.com> Just noticed you said the images are only 15k. Weird. Well, even without seeing the code, I think the suggestions of switching to imagemagick or splitting up the script will solve it. On Jun 4, 2009, at 11:25 AM, Rob Marscher wrote: > Sorry guys. iPhone prematurely sent that. > > The other idea is to buffer the download of the file. You can use > fopen/fread/fclose to make sure you only keep say 1mb of data in > php's memory while you download the file. Usually urls can be > treated like files via php's url file wrappers unless those have > been disabled. > > Or you can just > ini_set('memory_limit', '1500m'); > Or however much memory you have available for the script and see if > you can get by. > > Really though, there's no reason a script like this needs to use so > much memory. > > Sometimes when running batch scripts, i've seen memory usage > continue to rise through the iterations for unknown reasons. In that > case, I split the script so there's a master script that manages the > queue and another script that I exec to run the operation. That way > it's a separate process and memory is always cleaned up. > > Good luck, > Rob > > > On Jun 4, 2009, at 11:12 AM, Rob Marscher > wrote: > >> GD needs to operate on raw data so even if the jpegs are smaller >> than your 500mb limit, when it expands it, it will go over. >> >> A couple ideas... exec ImageMagick convert instead of using GD for >> the resize. >> >> On Jun 4, 2009, at 10:48 AM, Rahmin Pavlovic > out.com> wrote: >> >>> Heya, >>> >>> So, I have this script that does the following: >>> >>> 1. Requests jpeg from origin CDN via cURL >>> 2. If file doesnt exist... log error, continue. >>> 3. Write jpeg to temp file >>> 4. Resize original image (GD lib) to temp file. FTP to directory >>> on new CDN. Create directory structure if not present. Repeat >>> seven times per image. >>> >>> Not sure how many, but we're talking about 10k; maybe 15k images. >>> >>> The script works, but problem we're running into is the memory >>> limit. We got about 31% through the images, and hit: >>> >>> PHP Fatal error: Allowed memory size of 524288000 bytes exhausted >>> (tried to allocate 41760 bytes) in /web/lib/php/ >>> populate_images.php on line 135 >>> >>> Maybe it's me, but if we have to allot more than 500 MB of memory, >>> something is wrong. >>> >>> Any ideas? Maybe sleep the script after each image? >>> >>> We're running the script in shell. >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From y2rob at aol.com Thu Jun 4 12:39:38 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Thu, 04 Jun 2009 12:39:38 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com><47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> Message-ID: <8CBB34A2FC4CBA9-6F0-84C@FWM-M13.sysops.aol.com> yeah i think unset would work just fine. ~rob -----Original Message----- From: Eddie Drapkin To: NYPHP Talk Sent: Wed, 3 Jun 2009 9:26 pm Subject: Re: [nycphp-talk] delete one element from array Nope, because that'll unset the eighth element! You want unset($array[6]) :P And then if you want to re-key the array: array_slice($array) On Wed, Jun 3, 2009 at 9:17 PM, Darryle Steplight wrote: unset($array['7']) doesn't work? On Wed, Jun 3, 2009 at 9:14 PM, Michael Southwell wrote: > This has to be easy but I'm so pre-occupied with other stuff that I can't > get it. > > I have an array, let's say 12 elements. I want to remove element 7. I could > array_slice out the first 6 and also the last 5 and then combine those > resulting arrays but that seems like a very tedious way to do it. There has > to be an easier way???????? > -- > ================= > Michael Southwell > Vice President, Education > NYPHP TRAINING: ?http://nyphp.com/Training/Indepth > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- A: It reverses the normal flow of conversation. Q: What's wrong with top-posting? A: Top-posting. Q: What's the biggest scourge on plain text email discussions? _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From y2rob at aol.com Thu Jun 4 12:38:22 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Thu, 04 Jun 2009 12:38:22 -0400 Subject: [nycphp-talk] memory problems In-Reply-To: <5d515c620906040929l9c6c6e1md44d5ca669bc7f59@mail.gmail.com> References: <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com><14469483.9141244131227336.JavaMail.root@twoguyshosting.com.> <5d515c620906040929l9c6c6e1md44d5ca669bc7f59@mail.gmail.com> Message-ID: <8CBB34A0230E395-6F0-832@FWM-M13.sysops.aol.com> wow, awesome brent, i like the forking idea. question: how are you getting $files2process.? i'm assuming you're reading a directory if it were local, but can you get this number remotely from cURL? thanks ~rob -----Original Message----- From: Brent Baisley To: NYPHP Talk Sent: Thu, 4 Jun 2009 12:29 pm Subject: Re: [nycphp-talk] memory problems You are not releasing memory somewhere. Using sleep is not going to help in clearing memory. Monitor your memory usage (memory_get_usage) and see if your memory usage keeps climbing or if it's just 1 big image that is causing the problem. Alternatively, fork your script for each image if you are running it from the command line, and on unix. $maxForks = 20; while ( $files2process ) { $processFile = getNextFileURL(); for ( $i=0; $i<$maxForks; $i++ ) { $pid = pcntl_fork(); if ($pid == -1) { die('could not fork'); } else if ($pid) { // we are the parent $childPIDs[] = $pid; } else { ...process file... exit(); } // Wait for all the children to finish foreach($childPIDs as $pid) { pcntl_waitpid($pid, $status); echo '*** '.$pid. " ENDED\n"; } } Then a single image won't stop the whole process, the one image will just cause one child process to exit. This would also speed things up considerably since you can process multiple images at once. There are obviously holes in the script, but they should be easy to fill. Be aware that the system you are on may not have forking enabled. In which case, forget my whole response. Brent Baisley On Thu, Jun 4, 2009 at 12:00 PM, Donald J. Organ IV wrote: > Do you mind sharing the script? > > > ----- Original Message ----- > From: "Rahmin Pavlovic" > To: "NYPHP Talk" > Sent: Thursday, June 4, 2009 11:48:40 AM > Subject: [nycphp-talk] memory problems > > Heya, > > So, I have this script that does the following: > > 1. ?Requests jpeg from origin CDN via cURL > 2. ?If file doesnt exist... log error, continue. > 3. ?Write jpeg to temp file > 4. ?Resize original image (GD lib) to temp file. FTP to directory on > new CDN. ?Create directory structure if not present. ?Repeat seven > times per image. > > Not sure how many, but we're talking about 10k; maybe 15k images. > > The script works, but problem we're running into is the memory limit. > We got about 31% through the images, and hit: > > PHP Fatal error: Allowed memory size of 524288000 bytes exhausted > (tried to allocate 41760 bytes) in /web/lib/php/populate_images.php on > line 135 > > Maybe it's me, but if we have to allot more than 500 MB of memory, > something is wrong. > > Any ideas? ?Maybe sleep the script after each image? > > We're running the script in shell. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Thu Jun 4 13:34:40 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 4 Jun 2009 13:34:40 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <8CBB34A2FC4CBA9-6F0-84C@FWM-M13.sysops.aol.com> References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> <8CBB34A2FC4CBA9-6F0-84C@FWM-M13.sysops.aol.com> Message-ID: On Thu, Jun 4, 2009 at 12:39 PM, wrote: > yeah i think unset would work just fine. > So much for my serialize() / preg_replace() / unserialize() hack. From tmpvar at gmail.com Thu Jun 4 13:55:35 2009 From: tmpvar at gmail.com (Elijah Insua) Date: Thu, 4 Jun 2009 13:55:35 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> <8CBB34A2FC4CBA9-6F0-84C@FWM-M13.sysops.aol.com> Message-ID: <2b4feca10906041055v6e46e4aaq508c2ab4e08cf58a@mail.gmail.com> @chris, you forgot to json_encode, mail() to a remote service, and sleep() while you wait for the results On Thu, Jun 4, 2009 at 1:34 PM, Chris Snyder wrote: > On Thu, Jun 4, 2009 at 12:39 PM, wrote: > > yeah i think unset would work just fine. > > > > So much for my serialize() / preg_replace() / unserialize() hack. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Thu Jun 4 14:14:29 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 4 Jun 2009 14:14:29 -0400 Subject: [nycphp-talk] memory problems In-Reply-To: <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> References: <008c01c9e4bf$4604dca0$d20e95e0$@com> <20090604120511.1CE901CB2533@lists.nyphp.org> <002101c9e517$e537aed0$afa70c70$@com> <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> Message-ID: <8f0676b40906041114q31e0560cg6cf57f223c4832b2@mail.gmail.com> On Thu, Jun 4, 2009 at 11:48 AM, Rahmin Pavlovic wrote: > Heya, > > So, I have this script that does the following: > > 1. ?Requests jpeg from origin CDN via cURL > 2. ?If file doesnt exist... log error, continue. > 3. ?Write jpeg to temp file > 4. ?Resize original image (GD lib) to temp file. FTP to directory on new > CDN. ?Create directory structure if not present. ?Repeat seven times per > image. > > Not sure how many, but we're talking about 10k; maybe 15k images. > > The script works, but problem we're running into is the memory limit. ?We > got about 31% through the images, and hit: > > PHP Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to > allocate 41760 bytes) in /web/lib/php/populate_images.php on line 135 My guess is that you are not calling imagedestroy() after you are done with the image handle. You have to manually free the memory with GD. This generally isn't a problem with web processes, because everything is cleaned up at the end of the request. Regards, John Campbell From rahmin at insite-out.com Thu Jun 4 17:23:06 2009 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Thu, 4 Jun 2009 17:23:06 -0400 Subject: [nycphp-talk] memory problems In-Reply-To: <8f0676b40906041114q31e0560cg6cf57f223c4832b2@mail.gmail.com> References: <008c01c9e4bf$4604dca0$d20e95e0$@com> <20090604120511.1CE901CB2533@lists.nyphp.org> <002101c9e517$e537aed0$afa70c70$@com> <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> <8f0676b40906041114q31e0560cg6cf57f223c4832b2@mail.gmail.com> Message-ID: On Jun 4, 2009, at 2:14 PM, John Campbell wrote: > My guess is that you are not calling imagedestroy() after you are done > with the image handle. You have to manually free the memory with GD. We're destroying each handle after we're done with it, so I'm not exactly sure where the leak is, but it looks like it was introduced after we added the resizing methods. Might as well give ImageMagick a whirl. (I'd post the script, but have to edit it significantly first.) From glenn310b at mac.com Thu Jun 4 17:43:36 2009 From: glenn310b at mac.com (Glenn Powell) Date: Thu, 04 Jun 2009 17:43:36 -0400 Subject: [nycphp-talk] memory problems In-Reply-To: References: <008c01c9e4bf$4604dca0$d20e95e0$@com> <20090604120511.1CE901CB2533@lists.nyphp.org> <002101c9e517$e537aed0$afa70c70$@com> <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> <8f0676b40906041114q31e0560cg6cf57f223c4832b2@mail.gmail.com> Message-ID: <56316FE1-EA27-459C-A746-E8F9125E0348@mac.com> I had a similar problem and I added some old fashioned debug code using "echo" and "memory_get_usage" to see where the leaks were. It really helped, and it's very educational. (and fun...) HTH glenn On Jun 4, 2009, at 5:23 PM, Rahmin Pavlovic wrote: > On Jun 4, 2009, at 2:14 PM, John Campbell wrote: > >> My guess is that you are not calling imagedestroy() after you are >> done >> with the image handle. You have to manually free the memory with GD. > > We're destroying each handle after we're done with it, so I'm not > exactly sure where the leak is, but it looks like it was introduced > after we added the resizing methods. Might as well give ImageMagick > a whirl. (I'd post the script, but have to edit it significantly > first.) > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From consult at covenantedesign.com Thu Jun 4 18:11:04 2009 From: consult at covenantedesign.com (CED) Date: Thu, 04 Jun 2009 18:11:04 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> <8CBB34A2FC4CBA9-6F0-84C@FWM-M13.sysops.aol.com> Message-ID: <4A284678.1010506@covenantedesign.com> Chris Snyder wrote: > On Thu, Jun 4, 2009 at 12:39 PM, wrote: > >> yeah i think unset would work just fine. >> >> > > So much for my serialize() / preg_replace() / unserialize() hack. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > > Would be far more persistent... lol From mitch.pirtle at gmail.com Thu Jun 4 22:04:48 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 4 Jun 2009 22:04:48 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <2b4feca10906041055v6e46e4aaq508c2ab4e08cf58a@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> <8CBB34A2FC4CBA9-6F0-84C@FWM-M13.sysops.aol.com> <2b4feca10906041055v6e46e4aaq508c2ab4e08cf58a@mail.gmail.com> Message-ID: <330532b60906041904u2a9a54daw74db031517365e9@mail.gmail.com> Elijah, you forgot to use Amazon Queues. Sheesh. Amateurs. -- Mitch, trying to keep a straight face, and failing On Thu, Jun 4, 2009 at 1:55 PM, Elijah Insua wrote: > @chris, you forgot to json_encode, mail() to a remote service, and sleep() > while you wait for the results > > On Thu, Jun 4, 2009 at 1:34 PM, Chris Snyder wrote: >> >> On Thu, Jun 4, 2009 at 12:39 PM, ? wrote: >> > yeah i think unset would work just fine. >> > >> >> So much for my serialize() / preg_replace() / unserialize() hack. >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From brenttech at gmail.com Thu Jun 4 22:29:17 2009 From: brenttech at gmail.com (Brent Baisley) Date: Thu, 4 Jun 2009 22:29:17 -0400 Subject: [nycphp-talk] memory problems In-Reply-To: <8CBB34A0230E395-6F0-832@FWM-M13.sysops.aol.com> References: <6434C666-7A89-4DFB-BADD-53F12BF562DD@insite-out.com> <14469483.9141244131227336.JavaMail.root@twoguyshosting.com.> <5d515c620906040929l9c6c6e1md44d5ca669bc7f59@mail.gmail.com> <8CBB34A0230E395-6F0-832@FWM-M13.sysops.aol.com> Message-ID: <5d515c620906041929l2919282v25e12c146700f8a4@mail.gmail.com> That's one of the "holes" in the script. You can make it an array, a function, a counter, whatever. Some way of processing your list of files. Change it from while to for loop if needed. You just need some way to go through the list of files, assigning the url of the next one to the $processFile variable, which the child/forked process will process. Brent On Thu, Jun 4, 2009 at 12:38 PM, wrote: > wow, awesome brent, i like the forking idea. > > question: > how are you getting $files2process.? i'm assuming you're reading a directory > if it were local, but can you get this number remotely from cURL? > > thanks > ~rob > > > -----Original Message----- > From: Brent Baisley > To: NYPHP Talk > Sent: Thu, 4 Jun 2009 12:29 pm > Subject: Re: [nycphp-talk] memory problems > > You are not releasing memory somewhere. Using sleep is not going to > > help in clearing memory. Monitor your memory usage (memory_get_usage) > > and see if your memory usage keeps climbing or if it's just 1 big > > image that is causing the problem. > > > > Alternatively, fork your script for each image if you are running it > > from the command line, and on unix. > > > > $maxForks = 20; > > while ( $files2process ) { > > > > $processFile = getNextFileURL(); > > for ( $i=0; $i<$maxForks; $i++ ) { > > > > $pid = pcntl_fork(); > > if ($pid == -1) { > > die('could not fork'); > > } else if ($pid) { > > // we are the parent > > $childPIDs[] = $pid; > > } else { > > ...process file... > > exit(); > > } > > > > // Wait for all the children to finish > > foreach($childPIDs as $pid) { > > pcntl_waitpid($pid, $status); > > echo '*** '.$pid. " ENDED\n"; > > } > > > > } > > > > Then a single image won't stop the whole process, the one image will > > just cause one child process to exit. This would also speed things up > > considerably since you can process multiple images at once. There are > > obviously holes in the script, but they should be easy to fill. > > > > Be aware that the system you are on may not have forking enabled. In > > which case, forget my whole response. > > > > Brent Baisley > > > > > > On Thu, Jun 4, 2009 at 12:00 PM, Donald J. Organ IV > > wrote: > >> Do you mind sharing the script? > >> > >> > >> ----- Original Message ----- > >> From: "Rahmin Pavlovic" > >> To: "NYPHP Talk" > >> Sent: Thursday, June 4, 2009 11:48:40 AM > >> Subject: [nycphp-talk] memory problems > >> > >> Heya, > >> > >> So, I have this script that does the following: > >> > >> 1. ?Requests jpeg from origin CDN via cURL > >> 2. ?If file doesnt exist... log error, continue. > >> 3. ?Write jpeg to temp file > >> 4. ?Resize original image (GD lib) to temp file. FTP to directory on > >> new CDN. ?Create directory structure if not present. ?Repeat seven > >> times per image. > >> > >> Not sure how many, but we're talking about 10k; maybe 15k images. > >> > >> The script works, but problem we're running into is the memory limit. > >> We got about 31% through the images, and hit: > >> > >> PHP Fatal error: Allowed memory size of 524288000 bytes exhausted > >> (tried to allocate 41760 bytes) in /web/lib/php/populate_images.php on > >> line 135 > >> > >> Maybe it's me, but if we have to allot more than 500 MB of memory, > >> something is wrong. > >> > >> Any ideas? ?Maybe sleep the script after each image? > >> > >> We're running the script in shell. > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show_participation.php > >> > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > ________________________________ > Limited Time Offers: Save big on popular laptops at Dell > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From david at davidmintz.org Fri Jun 5 14:37:57 2009 From: david at davidmintz.org (David Mintz) Date: Fri, 5 Jun 2009 14:37:57 -0400 Subject: [nycphp-talk] updating code from php 3 to 5.2.6: pity me! Message-ID: <721f1cc50906051137v71766b6bm1dc4a3678cdf159c@mail.gmail.com> Just want you all to feel sorry for me for a second. Once upon a time, in the days of PHP3, someone coded a site (ok, it was me). Besides being a poster child for some of the world's worst practices, this code presumes register_globals and does a lot of other long-deprecated things. At long last, I am migrating to a new host and updating to PHP5. And discovering, for example, that there's no such thing as HTTP_POST_VARS any more. I am also introducing a nifty new language construct knowns as 'foreach.' Gonna to be doing a lot of grepping and perl -i -p -e '/bad code/good code/g' today. End of whine. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From y2rob at aol.com Fri Jun 5 15:58:37 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Fri, 05 Jun 2009 15:58:37 -0400 Subject: [nycphp-talk] updating code from php 3 to 5.2.6: pity me! In-Reply-To: <721f1cc50906051137v71766b6bm1dc4a3678cdf159c@mail.gmail.com> References: <721f1cc50906051137v71766b6bm1dc4a3678cdf159c@mail.gmail.com> Message-ID: <8CBB42F25DD13CD-E9C-673@FWM-M13.sysops.aol.com> wait there's no more HTTP_POST_VARS....crap damn to hell?!?!?!? :P ~rob -----Original Message----- From: David Mintz To: NYPHP Talk Sent: Fri, 5 Jun 2009 2:37 pm Subject: [nycphp-talk] updating code from php 3 to 5.2.6: pity me! Just want you all to feel sorry for me for a second. Once upon a time, in the days of PHP3, someone coded a site (ok, it was me). Besides being a poster child for some of the world's worst practices, this code presumes register_globals and does a? lot of other long-deprecated things. At long last, I am migrating to? a new host and updating to PHP5. And discovering, for example, that there's no such thing as HTTP_POST_VARS any more.? I am also introducing a nifty new language construct knowns as 'foreach.' Gonna to be doing a lot of grepping and perl -i -p -e '/bad code/good code/g' today. End of whine. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Fri Jun 5 16:16:06 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Fri, 5 Jun 2009 16:16:06 -0400 Subject: [nycphp-talk] updating code from php 3 to 5.2.6: pity me! In-Reply-To: <8CBB42F25DD13CD-E9C-673@FWM-M13.sysops.aol.com> References: <721f1cc50906051137v71766b6bm1dc4a3678cdf159c@mail.gmail.com> <8CBB42F25DD13CD-E9C-673@FWM-M13.sysops.aol.com> Message-ID: On Fri, Jun 5, 2009 at 3:58 PM, wrote: > wait there's no more HTTP_POST_VARS....crap damn to hell?!?!?!? > > :P > > ~rob > Not sure if you're kidding or not, but just use $_POST instead. From vtbludgeon at gmail.com Fri Jun 5 16:25:35 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Fri, 5 Jun 2009 16:25:35 -0400 Subject: [nycphp-talk] updating code from php 3 to 5.2.6: pity me! In-Reply-To: References: <721f1cc50906051137v71766b6bm1dc4a3678cdf159c@mail.gmail.com> <8CBB42F25DD13CD-E9C-673@FWM-M13.sysops.aol.com> Message-ID: <721f1cc50906051325o7ad7c505sb5e2dc77f9e3ceaf@mail.gmail.com> On Fri, Jun 5, 2009 at 4:16 PM, Chris Snyder wrote: > On Fri, Jun 5, 2009 at 3:58 PM, wrote: > > wait there's no more HTTP_POST_VARS....crap damn to hell?!?!?!? > > > > :P > > > > ~rob > > > > Not sure if you're kidding or not, but just use $_POST instead. > Yeah he's kidding. And btw I also found a copy of cgi-lib.pl lying around. Raise your hand if you're old enough to remember cgi-lib.pl. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From edwardpotter at gmail.com Fri Jun 5 17:46:27 2009 From: edwardpotter at gmail.com (Edward Potter) Date: Fri, 5 Jun 2009 17:46:27 -0400 Subject: [nycphp-talk] updating code from php 3 to 5.2.6: pity me! In-Reply-To: <721f1cc50906051325o7ad7c505sb5e2dc77f9e3ceaf@mail.gmail.com> References: <721f1cc50906051137v71766b6bm1dc4a3678cdf159c@mail.gmail.com> <8CBB42F25DD13CD-E9C-673@FWM-M13.sysops.aol.com> <721f1cc50906051325o7ad7c505sb5e2dc77f9e3ceaf@mail.gmail.com> Message-ID: <27479AAD-03DC-43D2-BF97-7FB26D9300DA@gmail.com> Of course, now can u name the university guy that cranked out the first code for cgi-lib.pl? Grad student, Clarkson, Potsdam, NY. Sent from my iPhone On Jun 5, 2009, at 4:25 PM, David Mintz wrote: > > > On Fri, Jun 5, 2009 at 4:16 PM, Chris Snyder > wrote: > On Fri, Jun 5, 2009 at 3:58 PM, wrote: > > wait there's no more HTTP_POST_VARS....crap damn to hell?!?!?!? > > > > :P > > > > ~rob > > > > Not sure if you're kidding or not, but just use $_POST instead. > > Yeah he's kidding. > > And btw I also found a copy of cgi-lib.pl lying around. Raise your > hand if you're old enough to remember cgi-lib.pl. > > > > -- > David Mintz > http://davidmintz.org/ > > The subtle source is clear and bright > The tributary streams flow through the darkness > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Fri Jun 5 18:20:14 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 5 Jun 2009 18:20:14 -0400 (EDT) Subject: [nycphp-talk] updating code from php 3 to 5.2.6: pity me! In-Reply-To: <721f1cc50906051325o7ad7c505sb5e2dc77f9e3ceaf@mail.gmail.com> Message-ID: On Fri, 5 Jun 2009, David Mintz wrote: > And btw I also found a copy of cgi-lib.pl lying around. Raise your hand if > you're old enough to remember cgi-lib.pl. Such a relief when CGI.pm came around! -- Aj. From brenttech at gmail.com Sat Jun 6 07:28:47 2009 From: brenttech at gmail.com (Brent Baisley) Date: Sat, 6 Jun 2009 07:28:47 -0400 Subject: [nycphp-talk] updating code from php 3 to 5.2.6: pity me! In-Reply-To: <721f1cc50906051137v71766b6bm1dc4a3678cdf159c@mail.gmail.com> References: <721f1cc50906051137v71766b6bm1dc4a3678cdf159c@mail.gmail.com> Message-ID: <83D055EB-28F0-432F-AF55-9F030092E31B@gmail.com> Egads!!! It's time to throw the whole program out and start from scratch. It would probably be quicker, easier and more stable in the long run just to start over. On Jun 5, 2009, at 2:37 PM, David Mintz wrote: > Just want you all to feel sorry for me for a second. > > Once upon a time, in the days of PHP3, someone coded a site (ok, it > was me). Besides being a poster child for some of the world's worst > practices, this code presumes register_globals and does a lot of > other long-deprecated things. At long last, I am migrating to a new > host and updating to PHP5. And discovering, for example, that > there's no such thing as HTTP_POST_VARS any more. I am also > introducing a nifty new language construct knowns as 'foreach.' > Gonna to be doing a lot of grepping and perl -i -p -e '/bad code/ > good code/g' today. > > End of whine. > > -- > David Mintz > http://davidmintz.org/ > > The subtle source is clear and bright > The tributary streams flow through the darkness > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at justinhileman.info Sun Jun 7 16:59:55 2009 From: justin at justinhileman.info (Justin Hileman) Date: Sun, 07 Jun 2009 16:59:55 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <330532b60906041904u2a9a54daw74db031517365e9@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> <8CBB34A2FC4CBA9-6F0-84C@FWM-M13.sysops.aol.com> <2b4feca10906041055v6e46e4aaq508c2ab4e08cf58a@mail.gmail.com> <330532b60906041904u2a9a54daw74db031517365e9@mail.gmail.com> Message-ID: <4A2C2A4B.5040905@justinhileman.info> Mitch Pirtle wrote: > Elijah, you forgot to use Amazon Queues. > > Sheesh. Amateurs. > > -- Mitch, trying to keep a straight face, and failing > > On Thu, Jun 4, 2009 at 1:55 PM, Elijah Insua wrote: >> @chris, you forgot to json_encode, mail() to a remote service, and sleep() >> while you wait for the results >> >> On Thu, Jun 4, 2009 at 1:34 PM, Chris Snyder wrote: >>> On Thu, Jun 4, 2009 at 12:39 PM, wrote: >>>> yeah i think unset would work just fine. >>>> >>> So much for my serialize() / preg_replace() / unserialize() hack. >>> I have a Yahoo! Pipe set up for just this purpose, if you want to use it. Just json_encode() your array, POST it via cURL to the appropriate URL, and parse the resulting RSS feed. :P -- justin http://justinhileman.com From greg at freephile.com Sun Jun 7 20:07:10 2009 From: greg at freephile.com (Greg Rundlett (freephile)) Date: Sun, 7 Jun 2009 20:07:10 -0400 Subject: [nycphp-talk] delete one element from array In-Reply-To: <4A2C2A4B.5040905@justinhileman.info> References: <4A271FE6.9060209@nyphp.com> <47f4c4570906031817p522b25dajb4a43c484ca172bc@mail.gmail.com> <68de37340906031826m1568b18ay20f0a80ff2431814@mail.gmail.com> <8CBB34A2FC4CBA9-6F0-84C@FWM-M13.sysops.aol.com> <2b4feca10906041055v6e46e4aaq508c2ab4e08cf58a@mail.gmail.com> <330532b60906041904u2a9a54daw74db031517365e9@mail.gmail.com> <4A2C2A4B.5040905@justinhileman.info> Message-ID: <5e2aaca40906071707j6c47112cx26c17e68867cfa8d@mail.gmail.com> > > I have a Yahoo! Pipe set up for just this purpose, if you want to use it. > Just json_encode() your array, POST it via cURL to the appropriate URL, and > parse the resulting RSS feed. > > :P I just use a butterfly for that http://xkcd.com/378/ -- Greg Rundlett Web Developer - Initiative in Innovative Computing http://iic.harvard.edu camb 617-384-5872 nbpt 978-225-8302 m. 978-764-4424 -skype/aim/irc/twitter freephile http://profiles.aim.com/freephile -------------- next part -------------- An HTML attachment was scrubbed... URL: From d at ingk.com Mon Jun 8 09:34:47 2009 From: d at ingk.com (Damion Hankejh (ingk)) Date: Mon, 8 Jun 2009 09:34:47 -0400 Subject: [nycphp-talk] Management class for CSV files In-Reply-To: <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> Message-ID: <00a201c9e83d$e4d23400$ae769c00$@com> Greetings, Any recommendations for a class to handle CSV files? Import CSV file, header parsing, and CSV file output required - exception handling preferred. ________________________________ Damion Hankejh | twit: hankejh -------------- next part -------------- An HTML attachment was scrubbed... URL: From zippy1981 at gmail.com Mon Jun 8 09:40:34 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Mon, 8 Jun 2009 09:40:34 -0400 Subject: [nycphp-talk] Management class for CSV files In-Reply-To: <00a201c9e83d$e4d23400$ae769c00$@com> References: <4A271FE6.9060209@nyphp.com> <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> <00a201c9e83d$e4d23400$ae769c00$@com> Message-ID: <5458db3c0906080640q5ed9bb10i7565fbf5a8bba679@mail.gmail.com> What sort of exceptions? Do you expect to be able to provide some sort of schema for the CSV columns and expect it to do type checking? What do you mean by CVS output? Do you want to alter some of the columns of the data, provide some sort of enrichment and write a new file? Do you want to make CVSs from another data source? You are being quite vague. On Mon, Jun 8, 2009 at 9:34 AM, Damion Hankejh (ingk) wrote: > Greetings, > > Any recommendations for a class to handle CSV files? Import CSV file, > header parsing, and CSV file output required ? exception handling preferred. > > ________________________________ > > Damion Hankejh | twit: hankejh > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From d at ingk.com Mon Jun 8 09:51:36 2009 From: d at ingk.com (Damion Hankejh (ingk)) Date: Mon, 8 Jun 2009 09:51:36 -0400 Subject: [nycphp-talk] Management class for CSV files In-Reply-To: <5458db3c0906080640q5ed9bb10i7565fbf5a8bba679@mail.gmail.com> References: <4A271FE6.9060209@nyphp.com> <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> <00a201c9e83d$e4d23400$ae769c00$@com> <5458db3c0906080640q5ed9bb10i7565fbf5a8bba679@mail.gmail.com> Message-ID: <00bf01c9e840$3e5ccd30$bb166790$@com> Hi Justin, I should have left exception handling out (it is the least important, though I'd like some handling around file access errors). I want to import CSV files for a given month (file formats are identical), concatenate their contents (without including headers from each file), and output the concatenated CSV file to disk. I do not need to alter data in the files, nor perform any type checking. D From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Justin Dearing Sent: Monday, June 08, 2009 9:41 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Management class for CSV files What sort of exceptions? Do you expect to be able to provide some sort of schema for the CSV columns and expect it to do type checking? What do you mean by CVS output? Do you want to alter some of the columns of the data, provide some sort of enrichment and write a new file? Do you want to make CVSs from another data source? You are being quite vague. On Mon, Jun 8, 2009 at 9:34 AM, Damion Hankejh (ingk) wrote: Greetings, Any recommendations for a class to handle CSV files? Import CSV file, header parsing, and CSV file output required - exception handling preferred. ________________________________ Damion Hankejh | twit: hankejh _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at davidmintz.org Mon Jun 8 13:34:42 2009 From: david at davidmintz.org (David Mintz) Date: Mon, 8 Jun 2009 13:34:42 -0400 Subject: [nycphp-talk] dedicated subdomain for SSL ? Message-ID: <721f1cc50906081034y3ef3dc2an64bb72a51e59f48b@mail.gmail.com> Ladies and gents, What's the latest greatest best practice for setting up an SSL-encrypted area of a site? Do we recommend creating a subdomain like ssl.example.org or secure.example.org, to emphasize to the users that they're accessing an SSL-secured site? Or is it not really necessary? Pros and cons? -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Mon Jun 8 13:49:30 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Mon, 8 Jun 2009 13:49:30 -0400 Subject: [nycphp-talk] dedicated subdomain for SSL ? In-Reply-To: <721f1cc50906081034y3ef3dc2an64bb72a51e59f48b@mail.gmail.com> References: <721f1cc50906081034y3ef3dc2an64bb72a51e59f48b@mail.gmail.com> Message-ID: On Mon, Jun 8, 2009 at 1:34 PM, David Mintz wrote: > Ladies and gents, > > What's the latest greatest best practice for setting up an SSL-encrypted > area of a site? Do we recommend creating a subdomain like ssl.example.org or > secure.example.org, to emphasize to the users that they're accessing an > SSL-secured site? Or is it not really necessary? Pros and cons? > That approach can minimize long-term costs -- funneling all secure traffic through one subdomain means that you only need a single commercially-signed certificate. That server can act as a reverse proxy for other internal servers with self-signed certificates if necessary. From rotsen at gmail.com Mon Jun 8 14:08:10 2009 From: rotsen at gmail.com (=?ISO-8859-1?B?TulzdG9y?=) Date: Mon, 8 Jun 2009 11:08:10 -0700 Subject: [nycphp-talk] is_readable fails on 744 directory Message-ID: People, I have a directory /home/vlieu set to 754 permission and inside that directory I have a file with permission of 744. drwxr-xr-- 4 vlieu www 4096 Jun 8 10:19 /home/vlieu -rwxr--r-- 1 vlieu vlieu 1023 Jun 8 10:19 /home/vlieu/bid.csv When accessing the bid.csv file using a php program the function is_readable() fails. I guess because the apache server runs the php file as user 'nobody'. If I make the directory 755 (drwxr-xr-x) user nobody can read the bid.csv file but if I make the permissions 754 (drwxr-xr--) user nobody can not read the file. WHY? In a 754 permission all users still have read permissions...what am I missing? Thanks, Nestor -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsnyder at gmail.com Mon Jun 8 14:17:51 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Mon, 8 Jun 2009 14:17:51 -0400 Subject: [nycphp-talk] is_readable fails on 744 directory In-Reply-To: References: Message-ID: On Mon, Jun 8, 2009 at 2:08 PM, N?stor wrote: > People, > > I have a directory /home/vlieu set to 754 permission and inside that > directory I have a > file with permission of 744. > drwxr-xr-- ?4 vlieu ?www ? 4096 Jun ?8 10:19 /home/vlieu > -rwxr--r-- 1 vlieu vlieu 1023 Jun ?8 10:19 /home/vlieu/bid.csv > > > When accessing the bid.csv file? using a php program the function > is_readable() > fails.? I guess because the apache server runs the php file as user > 'nobody'. > > If I make the directory 755 (drwxr-xr-x) user nobody can read the bid.csv > file but if I make > the permissions 754 (drwxr-xr--) user nobody can not read the file.? WHY? > In a 754 permission all users still have read permissions...what am I > missing? > > Thanks, > > Nestor Directory read only gives permission to see file names within the directory, not to find out anything else about them (such as whether they, themselves, are readable), or even to read them. http://en.wikipedia.org/wiki/File_system_permissions#Basic_Permissions The execute bit must be set on a directory in order to access files within it. Chris Snyder http://chxor.chxo.com/ From sequethin at gmail.com Mon Jun 8 14:24:51 2009 From: sequethin at gmail.com (Michael Hernandez) Date: Mon, 08 Jun 2009 14:24:51 -0400 Subject: [nycphp-talk] is_readable fails on 744 directory In-Reply-To: References: Message-ID: <1244485491.438.33.camel@mikeh-ubuntu> Directories need x permissions in order to be traversed. That's the difference. --Mike H On Mon, 2009-06-08 at 11:08 -0700, N?stor wrote: > People, > > I have a directory /home/vlieu set to 754 permission and inside that > directory I have a > file with permission of 744. > drwxr-xr-- 4 vlieu www 4096 Jun 8 10:19 /home/vlieu > -rwxr--r-- 1 vlieu vlieu 1023 Jun 8 10:19 /home/vlieu/bid.csv > > > When accessing the bid.csv file using a php program the function > is_readable() > fails. I guess because the apache server runs the php file as user > 'nobody'. > > If I make the directory 755 (drwxr-xr-x) user nobody can read the > bid.csv file but if I make > the permissions 754 (drwxr-xr--) user nobody can not read the file. > WHY? > In a 754 permission all users still have read permissions...what am I > missing? > > Thanks, > > Nestor > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From rotsen at gmail.com Mon Jun 8 14:28:09 2009 From: rotsen at gmail.com (=?ISO-8859-1?B?TulzdG9y?=) Date: Mon, 8 Jun 2009 11:28:09 -0700 Subject: [nycphp-talk] is_readable fails on 744 directory In-Reply-To: <1244485491.438.33.camel@mikeh-ubuntu> References: <1244485491.438.33.camel@mikeh-ubuntu> Message-ID: OK guys, Thanks for the info!!! On Mon, Jun 8, 2009 at 11:24 AM, Michael Hernandez wrote: > Directories need x permissions in order to be traversed. That's the > difference. > > --Mike H > > > On Mon, 2009-06-08 at 11:08 -0700, N?stor wrote: > > People, > > > > I have a directory /home/vlieu set to 754 permission and inside that > > directory I have a > > file with permission of 744. > > drwxr-xr-- 4 vlieu www 4096 Jun 8 10:19 /home/vlieu > > -rwxr--r-- 1 vlieu vlieu 1023 Jun 8 10:19 /home/vlieu/bid.csv > > > > > > When accessing the bid.csv file using a php program the function > > is_readable() > > fails. I guess because the apache server runs the php file as user > > 'nobody'. > > > > If I make the directory 755 (drwxr-xr-x) user nobody can read the > > bid.csv file but if I make > > the permissions 754 (drwxr-xr--) user nobody can not read the file. > > WHY? > > In a 754 permission all users still have read permissions...what am I > > missing? > > > > Thanks, > > > > Nestor > > > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From krozinov at gmail.com Mon Jun 8 15:36:02 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Mon, 8 Jun 2009 15:36:02 -0400 Subject: [nycphp-talk] Management class for CSV files In-Reply-To: <00a201c9e83d$e4d23400$ae769c00$@com> References: <4A271FE6.9060209@nyphp.com> <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> <00a201c9e83d$e4d23400$ae769c00$@com> Message-ID: <865a7acf0906081236h6ee6cddcrf921f90ad8e4fe20@mail.gmail.com> http://code.google.com/p/parsecsv-for-php/ I've used it before...it's pretty good, but had some minor issues, which may have been fixed in later versions. On Mon, Jun 8, 2009 at 9:34 AM, Damion Hankejh (ingk) wrote: > Greetings, > > Any recommendations for a class to handle CSV files?? Import CSV file, > header parsing, and CSV file output required ? exception handling preferred. > > ________________________________ > > Damion Hankejh | twit: hankejh > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From corey at core-industries.com Mon Jun 8 16:46:48 2009 From: corey at core-industries.com (corey szopinski) Date: Mon, 8 Jun 2009 16:46:48 -0400 Subject: [nycphp-talk] [JOB] Core Industries (Brooklyn) seeks mid-level developer Message-ID: <1A46A0C6-6500-4535-A77C-21E2421D38F8@core-industries.com> Core Industries is seeking an experienced PHP Developer to join our growing team of committed, conscientious, and talented stars. As a PHP Developer, you will be responsible for building high-profile, high- traffic websites, systems, and other interactive projects. This is a hands-on position, and you must be highly skilled with PHP, MySQL and SVN. You must be capable of working on a wide range of projects, architecting and building complex back-end content management tools, logical games, Facebook applications, mobile applications, server management tools, as well as bringing information forward to the presentation layer using AJAX, XML/Flash and/or Javascript. Responsibilities * Design and Develop backend systems on LAMP platform * Maintain and leverage SVN within a team environment * Provide system administration on our CentOS-based servers * Awareness of best practices and emerging technology / trends Skills * PHP 5 and OOP methodology * Strong grasp of design patterns * Experience with Subversion * 4 years of web development and a portfolio to show for it * HTML / CSS / AJAX experience * MySQL tuning experience * Strong attention to detail Core Industries is located in Brooklyn, New York. We are a new breed of interactive design shop. Not only do we marry high-end design with technology, but we also focus on the "triple bottom line" of people, planet, and profit. We seek to work with clients that do no harm, and we are looking for people that want to contribute to the world, as well as the world of business. http://core-industries.com We offer: * Competitive salary of up to $85k (based on experience) * Medical and Dental insurance * Retirement plan * Profit Sharing * A laid back work environment (Gunnar, the office chocolate lab sees to that) * Ongoing education * Flexibility to work offsite This position is for freelance leading to possible full-time staff position in our Dumbo office. To be considered, please send your cover letter, resume and example URLs to sayhello at core-industries.com with PHP DEVELOPER as the subject. Please describe your role in each project. From fgabrieli at gmail.com Mon Jun 8 23:44:03 2009 From: fgabrieli at gmail.com (Fernando Gabrieli) Date: Tue, 9 Jun 2009 00:44:03 -0300 Subject: [nycphp-talk] Management class for CSV files In-Reply-To: <00a201c9e83d$e4d23400$ae769c00$@com> References: <4A271FE6.9060209@nyphp.com> <8f0676b40906031840w241af4a2q283839940b14fe19@mail.gmail.com> <68de37340906031843u12c4cffdi2f247aeafef52c54@mail.gmail.com> <00a201c9e83d$e4d23400$ae769c00$@com> Message-ID: Hi Damion, What about these? http://pear.php.net/search.php?q=csv&in=packages&x=0&y=0 Best regards, Fernando On Mon, Jun 8, 2009 at 10:34 AM, Damion Hankejh (ingk) wrote: > Greetings, > > Any recommendations for a class to handle CSV files? Import CSV file, > header parsing, and CSV file output required ? exception handling preferred. > > ________________________________ > > Damion Hankejh | twit: hankejh > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans at cyberxdesigns.com Tue Jun 9 10:13:18 2009 From: hans at cyberxdesigns.com (Hans C. Kaspersetz) Date: Tue, 9 Jun 2009 10:13:18 -0400 Subject: [nycphp-talk] C# to PHP Message-ID: <20090609141319.424391CB2553@lists.nyphp.org> Good morning boys and girls, I need some help with converting about 20 lines of C# code to PHP. It is a key generator one of my client's vendors gave her that we need in PHP. Anyone interested and capable? Hans hans at cyberxdesigns.com From oorza2k5 at gmail.com Tue Jun 9 10:18:05 2009 From: oorza2k5 at gmail.com (oorza2k5 at gmail.com) Date: Tue, 09 Jun 2009 14:18:05 +0000 Subject: [nycphp-talk] C# to PHP In-Reply-To: <20090609141319.424391CB2553@lists.nyphp.org> Message-ID: <0016363b87a8faadfc046beb06ad@google.com> I'll try to help, I know some C# but it's been a while since I played with it, as I'm not exactly the biggest fan of Microsoft in the world. On Jun 9, 2009 10:13am, "Hans C. Kaspersetz" wrote: > Good morning boys and girls, > I need some help with converting about 20 lines of C# code to PHP. It is a > key generator one of my client's vendors gave her that we need in PHP. > Anyone interested and capable? > Hans > hans at cyberxdesigns.com > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From rizwan_nawaz786 at hotmail.com Wed Jun 10 13:21:31 2009 From: rizwan_nawaz786 at hotmail.com (Muhammad Rizwan Nawaz) Date: Wed, 10 Jun 2009 17:21:31 +0000 Subject: [nycphp-talk] C# to PHP In-Reply-To: <0016363b87a8faadfc046beb06ad@google.com> References: <20090609141319.424391CB2553@lists.nyphp.org> <0016363b87a8faadfc046beb06ad@google.com> Message-ID: Just explain in detail what type of key generator you are looking for. I hope there will be some solution available. Thanks Best Regards, Muhammad Rizwan Nawaz Email / MSN Messenger: rizwan_nawaz786 at hotmail.com Gmail: rizwannawaz at gmail.com Yahoo IM: rizwan051 AOL IM: riznawaz Skype: rizwannawaz ICQ: 442047681 ============= SECURITY NOTICE ============= THE INFORMATION CONTAINED IN THIS TRANSMISSION IS PRIVILEGED AND CONFIDENTIAL. IT IS INTENDED FOR THE USE OF THE INDIVIDUAL OR ENTITY NAMED ABOVE. IF THE READER OF THIS MESSAGE IS NOT THE INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION OR COPY OF THIS COMMUNICATION IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE IMMEDIATELY NOTIFY AND RETURN THE ORIGINAL MESSAGE TO THE SENDER AND DELETE IT. THANK YOU. Date: Tue, 9 Jun 2009 14:18:05 +0000 From: oorza2k5 at gmail.com To: hans at cyberxdesigns.com; talk at lists.nyphp.org Subject: Re: [nycphp-talk] C# to PHP I'll try to help, I know some C# but it's been a while since I played with it, as I'm not exactly the biggest fan of Microsoft in the world. On Jun 9, 2009 10:13am, "Hans C. Kaspersetz" wrote: > Good morning boys and girls, > > > > I need some help with converting about 20 lines of C# code to PHP. It is a > > key generator one of my client's vendors gave her that we need in PHP. > > Anyone interested and capable? > > > > Hans > > hans at cyberxdesigns.com > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > _________________________________________________________________ Windows Live?: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at projectskyline.com Wed Jun 10 13:29:46 2009 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 10 Jun 2009 13:29:46 -0400 Subject: [nycphp-talk] Bypassing Registration forms on vBulletin forums ... I guess other forums are having similar problem too? In-Reply-To: References: <441539530.20081014154122@qualityadvantages.com> <778347011.20081014234854@qualityadvantages.com> Message-ID: <4A2FED8A.20201@projectskyline.com> Hey, Have you searched for exploits for this 3.7 version? Who knows, maybe something is public and hasn't been patched yet. Also, I'd do a little research and see if someone is distributing some kinda vBulletin pwnage attack suite or similar. If you can find something, dig through the source and I'm sure you can secure against such attacks. I can't imagine there are tons' of 0days for this type of stuff sitting around...its got to surface sooner or later. Also, maybe you could log all SQL queries (if you feel its SQL injection) - You'll quickly find the offending query. However, I find it hard to believe that any modern, up to date web application is not using binded queries. But who knows. I have zero experience with vBulletin. Another option would be to setup a honey pot with vBulletin on it. You'll find the exploit with that, probably rather quickly, but this does require a good amount of effort if your new to honey pots. Good luck - and let us know, - Ben Brian Williams wrote: > if it has only started happening with the latest version i would check > the vBulletin forums and see if there is a fix for the bug, or to even > make sure they know about it. > > > > On Tue, Oct 14, 2008 at 11:48 AM, > wrote: > > Hello Brian, > > > Thanks for the reply... > > > I only work on vBulletin and I always make sure I have the latest > stuff installed. Earlier versions didn't have problem but since > 3.7 seems like the badguys have found a way to just bypass the > whole registration process. Like I said in the previous post with > captcha and moderation turned on, they still end up in the > "registered" member queue. I have not a clue how they got there. > > > I am trapping $_REQUEST to retrieve as much as I can from the form > submission to try to analyze what's going on, the software is > indeed using $_POST, sorry for the miscommunication. > > > -- > > Best regards, > > mikesz mailto:mikesz at qualityadvantages.com > > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > NYPHPCon 2006 Presentations Online > http://www.nyphpcon.com > > Show Your Participation in New York PHP > http://www.nyphp.org/show_participation.php From ben at projectskyline.com Wed Jun 10 13:34:16 2009 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 10 Jun 2009 13:34:16 -0400 Subject: [nycphp-talk] Bypassing Registration forms on vBulletin forums ... I guess other forums are having similar problem too? In-Reply-To: <4A2FED8A.20201@projectskyline.com> References: <441539530.20081014154122@qualityadvantages.com> <778347011.20081014234854@qualityadvantages.com> <4A2FED8A.20201@projectskyline.com> Message-ID: <4A2FEE98.1000500@projectskyline.com> haha sorry - email client went crazy! Ben Sgro wrote: > Hey, > > Have you searched for exploits for this 3.7 version? Who knows, maybe > something is public and hasn't been patched yet. Also, I'd do a little > research > and see if someone is distributing some kinda vBulletin pwnage attack > suite or similar. If you can find something, dig through the source > and I'm sure you can > secure against such attacks. > > I can't imagine there are tons' of 0days for this type of stuff > sitting around...its got to surface sooner or later. > > Also, maybe you could log all SQL queries (if you feel its SQL > injection) - You'll quickly find the offending query. However, I find > it hard to believe that > any modern, up to date web application is not using binded queries. > But who knows. I have zero experience with vBulletin. > > Another option would be to setup a honey pot with vBulletin on it. > You'll find the exploit with that, probably rather quickly, but this > does require a good amount of effort > if your new to honey pots. > > Good luck - and let us know, > > - Ben > > Brian Williams wrote: >> if it has only started happening with the latest version i would >> check the vBulletin forums and see if there is a fix for the bug, or >> to even make sure they know about it. >> >> >> >> On Tue, Oct 14, 2008 at 11:48 AM, > > wrote: >> >> Hello Brian, >> >> >> Thanks for the reply... >> >> >> I only work on vBulletin and I always make sure I have the latest >> stuff installed. Earlier versions didn't have problem but since >> 3.7 seems like the badguys have found a way to just bypass the >> whole registration process. Like I said in the previous post with >> captcha and moderation turned on, they still end up in the >> "registered" member queue. I have not a clue how they got there. >> >> >> I am trapping $_REQUEST to retrieve as much as I can from the form >> submission to try to analyze what's going on, the software is >> indeed using $_POST, sorry for the miscommunication. >> >> >> -- >> Best regards, >> >> mikesz >> mailto:mikesz at qualityadvantages.com >> >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From tmpvar at gmail.com Wed Jun 10 13:35:09 2009 From: tmpvar at gmail.com (Elijah Insua) Date: Wed, 10 Jun 2009 13:35:09 -0400 Subject: [nycphp-talk] Bypassing Registration forms on vBulletin forums ... I guess other forums are having similar problem too? In-Reply-To: <4A2FED8A.20201@projectskyline.com> References: <441539530.20081014154122@qualityadvantages.com> <778347011.20081014234854@qualityadvantages.com> <4A2FED8A.20201@projectskyline.com> Message-ID: <2b4feca10906101035v681e5b02wb0dbe0c37c9fc57d@mail.gmail.com> Hello, little bit of this, little bit of that, and some google : http://jamesseligman.net/is-vbulletin-37-recaptcha-verification-flawed/ -- Elijah On Wed, Jun 10, 2009 at 1:29 PM, Ben Sgro wrote: > Hey, > > Have you searched for exploits for this 3.7 version? Who knows, maybe > something is public and hasn't been patched yet. Also, I'd do a little > research > and see if someone is distributing some kinda vBulletin pwnage attack suite > or similar. If you can find something, dig through the source and I'm sure > you can > secure against such attacks. > > I can't imagine there are tons' of 0days for this type of stuff sitting > around...its got to surface sooner or later. > > Also, maybe you could log all SQL queries (if you feel its SQL injection) - > You'll quickly find the offending query. However, I find it hard to believe > that > any modern, up to date web application is not using binded queries. But who > knows. I have zero experience with vBulletin. > > Another option would be to setup a honey pot with vBulletin on it. You'll > find the exploit with that, probably rather quickly, but this does require a > good amount of effort > if your new to honey pots. > > Good luck - and let us know, > > - Ben > > Brian Williams wrote: > >> if it has only started happening with the latest version i would check the >> vBulletin forums and see if there is a fix for the bug, or to even make sure >> they know about it. >> >> >> >> On Tue, Oct 14, 2008 at 11:48 AM, > mikesz at qualityadvantages.com>> wrote: >> >> Hello Brian, >> >> >> Thanks for the reply... >> >> >> I only work on vBulletin and I always make sure I have the latest >> stuff installed. Earlier versions didn't have problem but since >> 3.7 seems like the badguys have found a way to just bypass the >> whole registration process. Like I said in the previous post with >> captcha and moderation turned on, they still end up in the >> "registered" member queue. I have not a clue how they got there. >> >> >> I am trapping $_REQUEST to retrieve as much as I can from the form >> submission to try to analyze what's going on, the software is >> indeed using $_POST, sorry for the miscommunication. >> >> >> -- >> Best regards, >> >> mikesz mailto:mikesz at qualityadvantages.com >> >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> New York PHP Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> NYPHPCon 2006 Presentations Online >> http://www.nyphpcon.com >> >> Show Your Participation in New York PHP >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Thu Jun 11 17:26:57 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 11 Jun 2009 17:26:57 -0400 Subject: [nycphp-talk] oo php Message-ID: <20090611212847149.WFQM1654@hrndva-omta02.mail.rr.com> I'm modifying a class. I need to use functions outside of the class like dbConnect(). How do I reference functions defined outside of the class? private function getLogin() { $link = dbConnect(); $query = "SELECT user_name, email_server FROM email_admin"; $result = mysql_query($query, $link); if ($row = mysql_fetch_array($result)) { $this->Username = $row[0]; $this->Host = $row[2]; } } It currently does not see to like external references. Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Thu Jun 11 17:31:01 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Thu, 11 Jun 2009 17:31:01 -0400 Subject: [nycphp-talk] oo php In-Reply-To: <20090611212847149.WFQM1654@hrndva-omta02.mail.rr.com> Message-ID: <20090611213250589.GIKV3293@hrndva-omta03.mail.rr.com> Nevermind. I had a typo in my require(). Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michele Waldman Sent: Thursday, June 11, 2009 5:27 PM To: 'NYPHP Talk' Subject: [nycphp-talk] oo php I'm modifying a class. I need to use functions outside of the class like dbConnect(). How do I reference functions defined outside of the class? private function getLogin() { $link = dbConnect(); $query = "SELECT user_name, email_server FROM email_admin"; $result = mysql_query($query, $link); if ($row = mysql_fetch_array($result)) { $this->Username = $row[0]; $this->Host = $row[2]; } } It currently does not see to like external references. Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuon1 at netzero.net Thu Jun 11 19:31:28 2009 From: tuon1 at netzero.net (tuon1 at netzero.net) Date: Thu, 11 Jun 2009 23:31:28 GMT Subject: [nycphp-talk] Header() Redirect!! Message-ID: <20090611.183128.2471.0@webmail08.dca.untd.com> Hi everybody! I need help in redirecting my link to a different page within my website. I read the manuan on "Header" function and it stae: Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file. If this statement is true, then how do you use header() function in any script that does not contain any "normal HTML tags" since you typically have to output something, whether before or after the call to the header()? It seems to me that type of rule is basically narrows the scope of the script to a very limited thing you can do, such as you can output the registration form to browser to allow the users to fill out the form, which is what I'm trying to. To be specifically, when a page is open, I present (output) a registration form to the users to register and when the user is finished with the form and I validate it and redirect that information to a different page sending those information along. That's all I'm trying to do--redirect from one page to the next without the end-user ever have to click on the link. Thanks in advance! Paul ____________________________________________________________ Click here to find the right stock, bonds, and mutual funds. http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxQyrstTv9ALqPlIM5yBT6GchJ8QPAP7e41G2Su1pHB6abtDTXsOcQ/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From krozinov at gmail.com Thu Jun 11 19:56:45 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Thu, 11 Jun 2009 19:56:45 -0400 Subject: [nycphp-talk] Header() Redirect!! In-Reply-To: <20090611.183128.2471.0@webmail08.dca.untd.com> References: <20090611.183128.2471.0@webmail08.dca.untd.com> Message-ID: <865a7acf0906111656k740361b0of77360ae7b510430@mail.gmail.com> You should place all of your PHP code that validates/redirects in the beginning of the HTML/PHP file, BEFORE any HTML is spit out.
... On Thu, Jun 11, 2009 at 7:31 PM, tuon1 at netzero.net wrote: > Hi everybody! > > I need help in redirecting my link to a different page within my website. I > read the manuan on "Header" function and it stae: > > Remember that header() must be called before any actual output is sent, > either by normal HTML tags, blank lines in a file, or from PHP. It is a very > common error to read code with include(), or require(), functions, or > another file access function, and have spaces or empty lines that are output > before header() is called. The same problem exists when using a single > PHP/HTML file. > > > /*?This?will?give?an?error.?Note?the?output > ?*?above,?which?is?before?the?header()?call?*/ > header('Location:?http://www.example.com/'); > ?> > > If this statement is true, then how do you use header() function in any > script that does not contain any "normal HTML tags" since you typically have > to output something, whether before or after the call to the header()? > > It seems to me that type of rule is basically narrows the scope of the > script to a very limited thing you can do, such as you can output the > registration form to browser to allow the users to fill out the form, which > is what I'm trying to. > > To be specifically, when a page is open, I present (output) a registration > form to the users to register and when the user is finished with the form > and I validate it and redirect that information to a different page sending > those information along. That's all I'm trying to do--redirect from one page > to the next without the end-user ever have to click on the link. > > Thanks in advance! > > Paul > > > > > ____________________________________________________________ > Click here to find the right stock, bonds, and mutual funds. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ben at projectskyline.com Thu Jun 11 20:17:02 2009 From: ben at projectskyline.com (Ben Sgro) Date: Thu, 11 Jun 2009 20:17:02 -0400 Subject: [nycphp-talk] Header() Redirect!! In-Reply-To: <865a7acf0906111656k740361b0of77360ae7b510430@mail.gmail.com> References: <20090611.183128.2471.0@webmail08.dca.untd.com> <865a7acf0906111656k740361b0of77360ae7b510430@mail.gmail.com> Message-ID: <4A319E7E.3060502@projectskyline.com> Correct, Have the page POST to itself, validate the form input in PHP and while still in PHP, redirect. Otherwise, if you have errors, generate the applicable HTML. Here's some pseudo code: "; } else { echo ""; } - Ben Konstantin Rozinov wrote: > You should place all of your PHP code that validates/redirects in the > beginning of the HTML/PHP file, BEFORE any HTML is spit out. > > code to validate.... > ?> > > > ... > > > > > On Thu, Jun 11, 2009 at 7:31 PM, tuon1 at netzero.net wrote: > >> Hi everybody! >> >> I need help in redirecting my link to a different page within my website. I >> read the manuan on "Header" function and it stae: >> >> Remember that header() must be called before any actual output is sent, >> either by normal HTML tags, blank lines in a file, or from PHP. It is a very >> common error to read code with include(), or require(), functions, or >> another file access function, and have spaces or empty lines that are output >> before header() is called. The same problem exists when using a single >> PHP/HTML file. >> >> >> > /* This will give an error. Note the output >> * above, which is before the header() call */ >> header('Location: http://www.example.com/'); >> ?> >> >> If this statement is true, then how do you use header() function in any >> script that does not contain any "normal HTML tags" since you typically have >> to output something, whether before or after the call to the header()? >> >> It seems to me that type of rule is basically narrows the scope of the >> script to a very limited thing you can do, such as you can output the >> registration form to browser to allow the users to fill out the form, which >> is what I'm trying to. >> >> To be specifically, when a page is open, I present (output) a registration >> form to the users to register and when the user is finished with the form >> and I validate it and redirect that information to a different page sending >> those information along. That's all I'm trying to do--redirect from one page >> to the next without the end-user ever have to click on the link. >> >> Thanks in advance! >> >> Paul >> >> >> >> >> ____________________________________________________________ >> Click here to find the right stock, bonds, and mutual funds. >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From tuon1 at netzero.net Thu Jun 11 21:56:20 2009 From: tuon1 at netzero.net (tuon1 at netzero.net) Date: Fri, 12 Jun 2009 01:56:20 GMT Subject: [nycphp-talk] Header() Redirect Message-ID: <20090611.205620.5581.0@webmail21.dca.untd.com> Hi everybody! Sorry, I deleted the last thread about the page redirection. This is the guy that needs help with the page redirection. Here is an abreviated code that I wanted to accomplish: " method="post">
Username
Password
} else { // Handle the incoming Post array from Login form above $LoginName = $_POST['Username']; $LoginPass = $_POST['Password']; //Validate code here //If OK, header("Location: http://www.example.com/myPage.php"); exit; } ?> Is there something is wrong? I tested it and it didn't give any error, but didn't redirect the page either. Any help? Thanks! Paul ____________________________________________________________ Click here for free information and resources about managing your inheritance. http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxQ00XjyIphwS4uGMYkr6ZRV0VpXdDmfbgB0IcJpIBFEIIs0U4bwdS/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramons at gmx.net Thu Jun 11 22:07:58 2009 From: ramons at gmx.net (David Krings) Date: Thu, 11 Jun 2009 22:07:58 -0400 Subject: [nycphp-talk] Header() Redirect!! In-Reply-To: <20090611.183128.2471.0@webmail08.dca.untd.com> References: <20090611.183128.2471.0@webmail08.dca.untd.com> Message-ID: <4A31B87E.10606@gmx.net> tuon1 at netzero.net wrote: > | > /* This will give an error. Note the output > * above, which is before the header() call */ > header('Location: http://www.example.com/'); > ?>| > || > |If this statement is true, then how do you use header() function in any > script that does not contain any "normal HTML tags" since you typically > have to output something, whether before or after the call to the header()?| The way I use header redirects is by first having a script that generates output and includes some sort of a form (can even be a static page). That form gets submitted to a script that evaluates the parameters and values passed and based on that redirects to other scripts that generate particular content. So yes, there is a good possibility that the script using the redirect never generates any output. BUT, some craft their applications using only a few files that each are a huge switch statement with various blocks of code. In those cases the first block can very well generate output whereas the second block has the redirects. It is just that when the second block gets called the first block is not executed. So it doesn't matter what comes first within the script, but what ultimately gets sent to the browser first. By the time the browser displays something it already got the header. So since the header is already sent you cannot modify it any longer. It's like trying to sign a check that you mailed yesterday and that the recipient already received. David From shaijudavis at gmail.com Thu Jun 11 22:39:33 2009 From: shaijudavis at gmail.com (shaiju davis) Date: Fri, 12 Jun 2009 08:09:33 +0530 Subject: [nycphp-talk] oo php In-Reply-To: <20090611212847149.WFQM1654@hrndva-omta02.mail.rr.com> References: <20090611212847149.WFQM1654@hrndva-omta02.mail.rr.com> Message-ID: <30ce306c0906111939m1c3da75agf24b1385279745cf@mail.gmail.com> hi, Include the class in the file and use classsName::functionName(). I hope it helps.. Thanks, Shaiju Davis. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tmpvar at gmail.com Fri Jun 12 00:02:02 2009 From: tmpvar at gmail.com (Elijah Insua) Date: Fri, 12 Jun 2009 00:02:02 -0400 Subject: [nycphp-talk] Header() Redirect!! In-Reply-To: <4A31B87E.10606@gmx.net> References: <20090611.183128.2471.0@webmail08.dca.untd.com> <4A31B87E.10606@gmx.net> Message-ID: <2b4feca10906112102k58226f7i2a8db8ade6090896@mail.gmail.com> You can also use output buffering for some interesting behavior [ http://us3.php.net/manual/en/book.outcontrol.php ] .... I prefer to set headers at the end of the script because it is at the end of processing a request that you are best able to do content-type negotiation and status based redirection. -- Elijah -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg at freephile.com Fri Jun 12 08:24:23 2009 From: greg at freephile.com (Greg Rundlett (freephile)) Date: Fri, 12 Jun 2009 08:24:23 -0400 Subject: [nycphp-talk] oo php In-Reply-To: <30ce306c0906111939m1c3da75agf24b1385279745cf@mail.gmail.com> References: <20090611212847149.WFQM1654@hrndva-omta02.mail.rr.com> <30ce306c0906111939m1c3da75agf24b1385279745cf@mail.gmail.com> Message-ID: <5e2aaca40906120524xb43cbb6ide5be45d87c606c1@mail.gmail.com> Assuming the class definition is in memory b/c the defining file is loaded (require, include, auto-load), you can call the method by either: a) instantiating an object instance of the class and then calling the method b) calling the method statically (having no object). See the manual for an example: http://us.php.net/manual/en/language.oop5.basic.php ~ Greg -- Greg Rundlett Web Developer - Initiative in Innovative Computing http://iic.harvard.edu camb 617-384-5872 nbpt 978-225-8302 m. 978-764-4424 -skype/aim/irc/twitter freephile http://profiles.aim.com/freephile -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at devonianfarm.com Fri Jun 12 09:41:15 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Fri, 12 Jun 2009 09:41:15 -0400 Subject: [nycphp-talk] Header() Redirect!! In-Reply-To: <4A31B87E.10606@gmx.net> References: <20090611.183128.2471.0@webmail08.dca.untd.com> <4A31B87E.10606@gmx.net> Message-ID: <4A325AFB.6080205@devonianfarm.com> David Krings wrote: > > So yes, there is a good possibility that the script using the redirect > never generates any output. BUT, some craft their applications using > only a few files that each are a huge switch statement with various > blocks of code. In those cases the first block can very well generate > output whereas the second block has the redirects. It is just that > when the second block gets called the first block is not executed. So > it doesn't matter what comes first within the script, but what > ultimately gets sent to the browser first. > Formalize this and you've got the paradigm that is (mis)-named MVC. Most web apps should (i) process input, (ii) think, then (iii) display something. The thing that gets displayed is called a "view", and one of the jobs of the "controller" is to display a different "view" depending on what the application thought in stage (ii). In a good system, the controller is able to surround a "view" with a "layout" (visual shell: all of the chrome that goes at the top of the page, on the side and on the bottom) or be able to do a redirect, or suppress the "layout" in case we want to send back, say, JSON or comma-separated text as an output. I think the roles of the controllers and views are non-controversial at this point, but the role of the "model" is more controversial. I like to call this architecture CAV (Controller-Action-View) since it reflects the organization of the code from the controller's viewpoint: the controller decides which action code to run, the action code recalls data from the database, changes data in the database or both, and then the controller displays a view. Although frameworks like Rails, Symfony and CakePHP have promoted these ideas, they may have also slowed the understanding of these ideas. (We think they're a property of a specific, complex, product rather than a self-evident truth.) A "micro-framework" that implements a powerful and complete controller can be implemented about 50 lines of PHP; you don't even need to use objects. As David mentions, you can also implement a "controller" by using switch statements or conditionals: there the "actions" and "views" are chunks of code that are inside the switch blocks. You can get the functional benefits of the CAV architecture this way, but the trouble is that your actions and views are mixed in with the controllers in one big file, and often it gets hard to maintain. In a mature CAV architecture, actions and views can be packed as individual source code files, or as individual functions, classes, or methods. "MVC" frameworks add all kinds of bells and whistles to this idea, but this is the heart of how they work. From mmwaldman at nyc.rr.com Fri Jun 12 09:41:50 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Fri, 12 Jun 2009 09:41:50 -0400 Subject: [nycphp-talk] SEO & Php Message-ID: <20090612134350852.VTVC9737@hrndva-omta01.mail.rr.com> I know that web crawlers doen't execute javascript when indexing webpages. Does the php get evaluated when indexing? I'm thinking I does. Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From sequethin at gmail.com Fri Jun 12 09:48:44 2009 From: sequethin at gmail.com (Michael Hernandez) Date: Fri, 12 Jun 2009 09:48:44 -0400 Subject: [nycphp-talk] SEO & Php In-Reply-To: <20090612134350852.VTVC9737@hrndva-omta01.mail.rr.com> References: <20090612134350852.VTVC9737@hrndva-omta01.mail.rr.com> Message-ID: <8312D6B0-D4C2-4A39-82CE-9A52B24FC099@gmail.com> On Jun 12, 2009, at 9:41 AM, Michele Waldman wrote: > I know that web crawlers doen?t execute javascript when indexing > webpages. > > Does the php get evaluated when indexing? I?m thinking I does. > > Michele > Your PHP code could definitely factor into SEO, take for example the difference between http://somedomain.com/1/1/2/useless/17/article.php?id=567 versus http://somedomain.com/articles/meaningfulname/specificstuff/page/2 The URL that is used to access your content could make a major difference. I'm not an SEO expert, but that is the difference between "search engine friendly URL" and it's opposite. CMS usually include a "Search engine friendly" feature, you might want to consider making your URLs friendly. --Mike H -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg at freephile.com Fri Jun 12 11:52:11 2009 From: greg at freephile.com (Greg Rundlett (freephile)) Date: Fri, 12 Jun 2009 11:52:11 -0400 Subject: [nycphp-talk] SEO & Php In-Reply-To: <20090612134350852.VTVC9737@hrndva-omta01.mail.rr.com> References: <20090612134350852.VTVC9737@hrndva-omta01.mail.rr.com> Message-ID: <5e2aaca40906120852u37318282xfb36f09466b0147e@mail.gmail.com> On Fri, Jun 12, 2009 at 9:41 AM, Michele Waldman wrote: > I know that web crawlers doen?t execute javascript when indexing > webpages. > > > > Does the php get evaluated when indexing? I?m thinking I does. > > > As a server-side scripting language, PHP is evaluated by the webserver (on the server) in response to a URI request. PHP code never makes it to any client (if the server is configured properly.) (Generated) HTML (and other content types) are returned to the browser or automated user agent. Some automated user agents do interpret javascript. ~ Greg -- Greg Rundlett Web Developer - Initiative in Innovative Computing http://iic.harvard.edu camb 617-384-5872 nbpt 978-225-8302 m. 978-764-4424 -skype/aim/irc/twitter freephile http://profiles.aim.com/freephile -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Fri Jun 12 13:08:19 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Fri, 12 Jun 2009 13:08:19 -0400 Subject: [nycphp-talk] oo php In-Reply-To: <5e2aaca40906120524xb43cbb6ide5be45d87c606c1@mail.gmail.com> References: <20090611212847149.WFQM1654@hrndva-omta02.mail.rr.com> <30ce306c0906111939m1c3da75agf24b1385279745cf@mail.gmail.com> <5e2aaca40906120524xb43cbb6ide5be45d87c606c1@mail.gmail.com> Message-ID: <721f1cc50906121008v66b51027mfb0cd570051f2d0@mail.gmail.com> On Fri, Jun 12, 2009 at 8:24 AM, Greg Rundlett (freephile) < greg at freephile.com> wrote: > Assuming the class definition is in memory b/c the defining file is loaded > (require, include, auto-load), > you can call the method by either: > a) instantiating an object instance of the class and then calling the > method > b) calling the method statically (having no object). > See the manual for an example: > http://us.php.net/manual/en/language.oop5.basic.php > It looks like Michele's original snippet had the method marked as private. That means by definition that the method can only be called from within the class itself -- $this->somePrivateMethod() As for static vs instance methods, I believe the best PHP5 practice is to mark a method as static if you intend to call it statically, ditto for instance methods, i.e., don't make them static. Offhand I forget which transgressions are fatal and which are warnings, but I think the best practice is well established. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtbludgeon at gmail.com Fri Jun 12 13:11:12 2009 From: vtbludgeon at gmail.com (David Mintz) Date: Fri, 12 Jun 2009 13:11:12 -0400 Subject: [nycphp-talk] oo php In-Reply-To: <721f1cc50906121008v66b51027mfb0cd570051f2d0@mail.gmail.com> References: <20090611212847149.WFQM1654@hrndva-omta02.mail.rr.com> <30ce306c0906111939m1c3da75agf24b1385279745cf@mail.gmail.com> <5e2aaca40906120524xb43cbb6ide5be45d87c606c1@mail.gmail.com> <721f1cc50906121008v66b51027mfb0cd570051f2d0@mail.gmail.com> Message-ID: <721f1cc50906121011x4c47fdc3o6bd3670451ba040f@mail.gmail.com> On Fri, Jun 12, 2009 at 1:08 PM, David Mintz wrote: > > > On Fri, Jun 12, 2009 at 8:24 AM, Greg Rundlett (freephile) < > greg at freephile.com> wrote: > >> Assuming the class definition is in memory b/c the defining file is loaded >> (require, include, auto-load), >> you can call the method by either: >> a) instantiating an object instance of the class and then calling the >> method >> b) calling the method statically (having no object). >> See the manual for an example: >> http://us.php.net/manual/en/language.oop5.basic.php >> > > It looks like Michele's original snippet had the method marked as private. > That means by definition that the method can only be called from within the > class itself -- $this->somePrivateMethod() > > Sorry I spoke too soon. I see Michele was talking about invoking dbConnect() from within the private method (duh). On a second look it seems there may be some confusion between procedural vs OO. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Fri Jun 12 23:35:04 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Fri, 12 Jun 2009 23:35:04 -0400 Subject: [nycphp-talk] SEO & Php In-Reply-To: <5e2aaca40906120852u37318282xfb36f09466b0147e@mail.gmail.com> Message-ID: <20090613033653078.GQWM10463@hrndva-omta04.mail.rr.com> Yeah. I was thinking since the server evaluates the page when it's requested all it's getting is the resulting html. If I can't get the php without it being evaluated, then I was getting the search engines couldn't either. I don't know why I bothered asking. I knew. This is great for my client's client. I was thinking javascript and then I got off the phone and realized all was good. Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Greg Rundlett (freephile) Sent: Friday, June 12, 2009 11:52 AM To: NYPHP Talk Subject: Re: [nycphp-talk] SEO & Php On Fri, Jun 12, 2009 at 9:41 AM, Michele Waldman wrote: I know that web crawlers doen't execute javascript when indexing webpages. Does the php get evaluated when indexing? I'm thinking I does. As a server-side scripting language, PHP is evaluated by the webserver (on the server) in response to a URI request. PHP code never makes it to any client (if the server is configured properly.) (Generated) HTML (and other content types) are returned to the browser or automated user agent. Some automated user agents do interpret javascript. ~ Greg -- Greg Rundlett Web Developer - Initiative in Innovative Computing http://iic.harvard.edu camb 617-384-5872 nbpt 978-225-8302 m. 978-764-4424 -skype/aim/irc/twitter freephile http://profiles.aim.com/freephile -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Fri Jun 12 23:53:19 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Fri, 12 Jun 2009 23:53:19 -0400 Subject: [nycphp-talk] oo php In-Reply-To: <721f1cc50906121011x4c47fdc3o6bd3670451ba040f@mail.gmail.com> Message-ID: <20090613035508251.COSD3293@hrndva-omta03.mail.rr.com> No. There was no confusion between procedural and OO. I was calling a procedural function from an OO function. I was in a hurry to customize a class with some queried data not from a database class, which I could have been using, but from some old procedural code that I had written. Everyone is always in a hurry and want me to produce immediately. Whether or not I integrate a db class into the code or use procedural database code is not an issue. I thought I was missing something in doing that other than writing procedural code in the OO. I had a typo in my include. I wasn't getting a php error, though. I was getting nothing, so I was running through the possibilities of problems. I wasn't quite sure what was going on. It took me a few minutes to find I typed $_SEVER[, not $_SERVER[. I figured it out right after I posted. I typed require, too and also didn't get an error. Usually, I get an include or require error. That's why I was confused for a second. I've been planning on doing more OO code. There really hasn't been much of an opportunity, but I ran into some weird issues with a xajax class for more than one object, so I thought for a NY minute that there was a weird issue, but their wasn't. I want to do more oo, but I don't really see the advantage even though I know the argued advantages. I think oo is just hipper. Now, Sir Francis Bacon's Four Idles would argue against this kind of motivation, but that's my only real motivation. Hipness. My bad for posting. Sorry. I really don't need you guys for much anymore, but sometimes I think if I run into a seeming problem I'll consult y'all. In the past, y'all have been very helpful, but I'm maturing a little in my development. I'm really getting to be more independent. Sorry, for the silly posting. I still sometimes want to post here, even though I don't' need to much anymore. For any silly, little issue, I think "I'll ask the guys". But, thanks for your consideration. It is great that you guys are here in case a person is in a real bind. Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Mintz Sent: Friday, June 12, 2009 1:11 PM To: NYPHP Talk Subject: Re: [nycphp-talk] oo php On Fri, Jun 12, 2009 at 1:08 PM, David Mintz wrote: On Fri, Jun 12, 2009 at 8:24 AM, Greg Rundlett (freephile) wrote: Assuming the class definition is in memory b/c the defining file is loaded (require, include, auto-load), you can call the method by either: a) instantiating an object instance of the class and then calling the method b) calling the method statically (having no object). See the manual for an example: http://us.php.net/manual/en/language.oop5.basic.php It looks like Michele's original snippet had the method marked as private. That means by definition that the method can only be called from within the class itself -- $this->somePrivateMethod() Sorry I spoke too soon. I see Michele was talking about invoking dbConnect() from within the private method (duh). On a second look it seems there may be some confusion between procedural vs OO. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness -------------- next part -------------- An HTML attachment was scrubbed... URL: From edwardpotter at gmail.com Wed Jun 17 10:21:57 2009 From: edwardpotter at gmail.com (Edward Potter) Date: Wed, 17 Jun 2009 10:21:57 -0400 Subject: [nycphp-talk] PHP: Display Adobe PSD files on a web page Message-ID: A small library that slipped under the radar. Seems like could be pretty important to some image wranglers ... ? http://www.catswhocode.com/blog/php-display-adobe-psd-files-on-a-web-page From dsteplight at gmail.com Wed Jun 17 10:58:39 2009 From: dsteplight at gmail.com (Darryle Steplight) Date: Wed, 17 Jun 2009 10:58:39 -0400 Subject: [nycphp-talk] PHP: Display Adobe PSD files on a web page In-Reply-To: References: Message-ID: <47f4c4570906170758u148f717apcf93bb8f3b440e9f@mail.gmail.com> It looks like you are not actually displaying the PSD on the webpage. The class just converts the PSD into a JPEG and then displays the JPG to the browser. If you have Photoshop, I feel you might as well do this yourself before uploading the image. Uploading JPGs versus PSD is much faster and saves space anyway. I guess it's cool that there is a class with these abilities, but I can't see this being terribly useful. It's cool in those emergency cases where you only have the PSD version of a file. On Wed, Jun 17, 2009 at 10:21 AM, Edward Potter wrote: > A small library that slipped under the radar. ?Seems like could be > pretty important to some image wranglers ... ?? > > http://www.catswhocode.com/blog/php-display-adobe-psd-files-on-a-web-page > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- A: It reverses the normal flow of conversation. Q: What's wrong with top-posting? A: Top-posting. Q: What's the biggest scourge on plain text email discussions? From tomsartain at gmail.com Thu Jun 18 00:51:40 2009 From: tomsartain at gmail.com (Tom Sartain) Date: Thu, 18 Jun 2009 00:51:40 -0400 Subject: [nycphp-talk] PHP: Display Adobe PSD files on a web page In-Reply-To: <47f4c4570906170758u148f717apcf93bb8f3b440e9f@mail.gmail.com> References: <47f4c4570906170758u148f717apcf93bb8f3b440e9f@mail.gmail.com> Message-ID: <20190d950906172151l59c65cd4o16a96cd2324113b1@mail.gmail.com> I could see this being really useful for designer websites or tutorial websites where there is often a PSD available for download. No sense going through the trouble of exporting a JPG if this can do it automatically. One way or another, cracking the PSD format makes for fun code. I'll have to try it out... and put some sort of caching on that example script, because re-rendering it each request can not be fun. On Wed, Jun 17, 2009 at 10:58 AM, Darryle Steplight wrote: > It looks like you are not actually displaying the PSD on the webpage. > The class just converts the PSD into a JPEG and then displays the JPG > to the browser. If you have Photoshop, I feel you might as well do > this yourself before uploading the image. Uploading JPGs versus PSD is > much faster and saves space anyway. > > I guess it's cool that there is a class with these abilities, but I > can't see this being terribly useful. It's cool in those emergency > cases where you only have the PSD version of a file. > > On Wed, Jun 17, 2009 at 10:21 AM, Edward Potter > wrote: > > A small library that slipped under the radar. Seems like could be > > pretty important to some image wranglers ... ? > > > > > http://www.catswhocode.com/blog/php-display-adobe-psd-files-on-a-web-page > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > > > > -- > A: It reverses the normal flow of conversation. > Q: What's wrong with top-posting? > A: Top-posting. > Q: What's the biggest scourge on plain text email discussions? > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at justinhileman.info Thu Jun 18 10:11:51 2009 From: justin at justinhileman.info (Justin Hileman) Date: Thu, 18 Jun 2009 10:11:51 -0400 Subject: [nycphp-talk] PHP: Display Adobe PSD files on a web page In-Reply-To: <20190d950906172151l59c65cd4o16a96cd2324113b1@mail.gmail.com> References: <47f4c4570906170758u148f717apcf93bb8f3b440e9f@mail.gmail.com> <20190d950906172151l59c65cd4o16a96cd2324113b1@mail.gmail.com> Message-ID: <4A3A4B27.7050007@justinhileman.info> Tom Sartain wrote: > One way or another, cracking the PSD format makes for fun code. I'll > have to try it out... and put some sort of caching on that example > script, because re-rendering it each request can not be fun. This made the rounds of the internets a while back, but it's a bit related: http://code.google.com/p/xee/source/browse/trunk/XeePhotoshopLoader.m?r=11#107 :) -- justin http://justinhileman.com From jc at webdev.jennchiu.info Mon Jun 22 22:29:43 2009 From: jc at webdev.jennchiu.info (jc at webdev.jennchiu.info) Date: Mon, 22 Jun 2009 21:29:43 -0500 Subject: [nycphp-talk] talk Digest, Vol 32, Issue 16 In-Reply-To: References: Message-ID: <20090622212943.hri3yb54tw4ggokk@webmail.opentransfer.com> Paul, have you found your solution yet? (Yea, my reply here is quite late . . . have not been checking mail.) Anyway, if you haven't the solution, here's the correct code . . .
Username
Password
Hope this helps. jc Quoting talk-request at lists.nyphp.org: > Send talk mailing list submissions to > talk at lists.nyphp.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.nyphp.org/mailman/listinfo/talk > or, via email, send a message with subject or body 'help' to > talk-request at lists.nyphp.org > > You can reach the person managing the list at > talk-owner at lists.nyphp.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of talk digest..." > > > Today's Topics: > > 1. Header() Redirect (tuon1 at netzero.net) > 2. Re: Header() Redirect!! (David Krings) > 3. Re: oo php (shaiju davis) > 4. Re: Header() Redirect!! (Elijah Insua) > 5. Re: oo php (Greg Rundlett (freephile)) > 6. Re: Header() Redirect!! (Paul A Houle) > 7. SEO & Php (Michele Waldman) > 8. Re: SEO & Php (Michael Hernandez) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 12 Jun 2009 01:56:20 GMT > From: "tuon1 at netzero.net" > To: talk at lists.nyphp.org > Subject: [nycphp-talk] Header() Redirect > Message-ID: <20090611.205620.5581.0 at webmail21.dca.untd.com> > Content-Type: text/plain; charset="windows-1252" > > Hi everybody! > Sorry, I deleted the last thread about the page redirection. This is > the guy that needs help with the page redirection. > Here is an abreviated code that I wanted to accomplish: > if ( !isset($_POST['Username']) && !isset(_POST['Password'])) > { >
> > > > > >
Username size="30">
Password size="30">
>
> } > else > { > // Handle the incoming Post array from Login form above > $LoginName = $_POST['Username']; > $LoginPass = $_POST['Password']; > //Validate code here > //If OK, > header("Location: http://www.example.com/myPage.php"); > exit; > } > ?> > Is there something is wrong? > I tested it and it didn't give any error, but didn't redirect the > page either. > Any help? > Thanks! > Paul > > > ____________________________________________________________ > Click here for free information and resources about managing your > inheritance. > http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxQ00XjyIphwS4uGMYkr6ZRV0VpXdDmfbgB0IcJpIBFEIIs0U4bwdS/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 2 > Date: Thu, 11 Jun 2009 22:07:58 -0400 > From: David Krings > To: NYPHP Talk > Subject: Re: [nycphp-talk] Header() Redirect!! > Message-ID: <4A31B87E.10606 at gmx.net> > Content-Type: text/plain; charset=windows-1252; format=flowed > > tuon1 at netzero.net wrote: > > | >> > /* This will give an error. Note the output >> * above, which is before the header() call */ >> header('Location: http://www.example.com/'); >> ?>| >> || >> |If this statement is true, then how do you use header() function in any >> script that does not contain any "normal HTML tags" since you typically >> have to output something, whether before or after the call to the header()?| > > The way I use header redirects is by first having a script that generates > output and includes some sort of a form (can even be a static page). > That form > gets submitted to a script that evaluates the parameters and values > passed and > based on that redirects to other scripts that generate particular content. > > So yes, there is a good possibility that the script using the redirect never > generates any output. BUT, some craft their applications using only a few > files that each are a huge switch statement with various blocks of code. In > those cases the first block can very well generate output whereas the second > block has the redirects. It is just that when the second block gets > called the > first block is not executed. So it doesn't matter what comes first within the > script, but what ultimately gets sent to the browser first. > By the time the browser displays something it already got the > header. So since > the header is already sent you cannot modify it any longer. It's like trying > to sign a check that you mailed yesterday and that the recipient > already received. > > David > > > ------------------------------ > > Message: 3 > Date: Fri, 12 Jun 2009 08:09:33 +0530 > From: shaiju davis > To: NYPHP Talk > Subject: Re: [nycphp-talk] oo php > Message-ID: > <30ce306c0906111939m1c3da75agf24b1385279745cf at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > hi, > > Include the class in the file and use classsName::functionName(). I hope > it helps.. > > > Thanks, > Shaiju Davis. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 4 > Date: Fri, 12 Jun 2009 00:02:02 -0400 > From: Elijah Insua > To: NYPHP Talk > Subject: Re: [nycphp-talk] Header() Redirect!! > Message-ID: > <2b4feca10906112102k58226f7i2a8db8ade6090896 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > You can also use output buffering for some interesting behavior > > [ http://us3.php.net/manual/en/book.outcontrol.php ] > > ob_start() > ?> > > > .... > > > > if ($success) > { > header("Location: /success"); > } > > ob_flush_clean() > ?> > > I prefer to set headers at the end of the script because it is at the end of > processing > a request that you are best able to do content-type negotiation and status > based redirection. > > -- Elijah > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 5 > Date: Fri, 12 Jun 2009 08:24:23 -0400 > From: "Greg Rundlett (freephile)" > To: NYPHP Talk > Subject: Re: [nycphp-talk] oo php > Message-ID: > <5e2aaca40906120524xb43cbb6ide5be45d87c606c1 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Assuming the class definition is in memory b/c the defining file is loaded > (require, include, auto-load), > you can call the method by either: > a) instantiating an object instance of the class and then calling the method > b) calling the method statically (having no object). > See the manual for an example: > http://us.php.net/manual/en/language.oop5.basic.php > > ~ Greg > > -- > Greg Rundlett > Web Developer - Initiative in Innovative Computing > http://iic.harvard.edu > camb 617-384-5872 > nbpt 978-225-8302 > m. 978-764-4424 > -skype/aim/irc/twitter freephile > http://profiles.aim.com/freephile > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 6 > Date: Fri, 12 Jun 2009 09:41:15 -0400 > From: Paul A Houle > To: NYPHP Talk > Subject: Re: [nycphp-talk] Header() Redirect!! > Message-ID: <4A325AFB.6080205 at devonianfarm.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > David Krings wrote: >> >> So yes, there is a good possibility that the script using the redirect >> never generates any output. BUT, some craft their applications using >> only a few files that each are a huge switch statement with various >> blocks of code. In those cases the first block can very well generate >> output whereas the second block has the redirects. It is just that >> when the second block gets called the first block is not executed. So >> it doesn't matter what comes first within the script, but what >> ultimately gets sent to the browser first. >> > Formalize this and you've got the paradigm that is (mis)-named MVC. > > Most web apps should (i) process input, (ii) think, then (iii) > display something. The thing that gets displayed is called a "view", > and one of the jobs of the "controller" is to display a different "view" > depending on what the application thought in stage (ii). In a good > system, the controller is able to surround a "view" with a "layout" > (visual shell: all of the chrome that goes at the top of the page, on > the side and on the bottom) or be able to do a redirect, or suppress > the "layout" in case we want to send back, say, JSON or > comma-separated text as an output. > > I think the roles of the controllers and views are non-controversial > at this point, but the role of the "model" is more controversial. I > like to call this architecture CAV (Controller-Action-View) since it > reflects the organization of the code from the controller's viewpoint: > the controller decides which action code to run, the action code > recalls data from the database, changes data in the database or both, > and then the controller displays a view. > > Although frameworks like Rails, Symfony and CakePHP have promoted > these ideas, they may have also slowed the understanding of these > ideas. (We think they're a property of a specific, complex, product > rather than a self-evident truth.) A "micro-framework" that implements > a powerful and complete controller can be implemented about 50 lines of > PHP; you don't even need to use objects. > > As David mentions, you can also implement a "controller" by using > switch statements or conditionals: there the "actions" and "views" are > chunks of code that are inside the switch blocks. You can get the > functional benefits of the CAV architecture this way, but the trouble > is that your actions and views are mixed in with the controllers in one > big file, and often it gets hard to maintain. In a mature CAV > architecture, actions and views can be packed as individual source code > files, or as individual functions, classes, or methods. > > "MVC" frameworks add all kinds of bells and whistles to this idea, > but this is the heart of how they work. > > > ------------------------------ > > Message: 7 > Date: Fri, 12 Jun 2009 09:41:50 -0400 > From: "Michele Waldman" > To: "'NYPHP Talk'" > Subject: [nycphp-talk] SEO & Php > Message-ID: <20090612134350852.VTVC9737 at hrndva-omta01.mail.rr.com> > Content-Type: text/plain; charset="us-ascii" > > I know that web crawlers doen't execute javascript when indexing webpages. > > > > Does the php get evaluated when indexing? I'm thinking I does. > > > > Michele > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 8 > Date: Fri, 12 Jun 2009 09:48:44 -0400 > From: Michael Hernandez > To: NYPHP Talk > Subject: Re: [nycphp-talk] SEO & Php > Message-ID: <8312D6B0-D4C2-4A39-82CE-9A52B24FC099 at gmail.com> > Content-Type: text/plain; charset="windows-1252"; Format="flowed"; > DelSp="yes" > > > On Jun 12, 2009, at 9:41 AM, Michele Waldman wrote: > >> I know that web crawlers doen?t execute javascript when indexing >> webpages. >> >> Does the php get evaluated when indexing? I?m thinking I does. >> >> Michele >> > > Your PHP code could definitely factor into SEO, take for example the > difference between > > http://somedomain.com/1/1/2/useless/17/article.php?id=567 > > versus > > http://somedomain.com/articles/meaningfulname/specificstuff/page/2 > > The URL that is used to access your content could make a major > difference. I'm not an SEO expert, but that is the difference between > "search engine friendly URL" and it's opposite. CMS usually include a > "Search engine friendly" feature, you might want to consider making > your URLs friendly. > > --Mike H > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > End of talk Digest, Vol 32, Issue 16 > ************************************ > From mmwaldman at nyc.rr.com Tue Jun 23 11:39:59 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Tue, 23 Jun 2009 11:39:59 -0400 Subject: [nycphp-talk] [JOB] Part-time Work In-Reply-To: <1A46A0C6-6500-4535-A77C-21E2421D38F8@core-industries.com> Message-ID: <20090623153958424.RXSL85@hrndva-omta03.mail.rr.com> My company or me is available for a regular part-time gig. Preferably 20 hours a week. No more than 30 hours a week. (On occasion, I could make exception and work more hours, but not on a regular basis.) My company charges ridiculously low rates, plus I pick-up all the payroll taxes. Now that's a good deal. If I were an employee, I have an unusual fringe benefit requirement, but my salary request would be lower than scale. So, if you need regular work but don't need a full-time employee or company, I'm available. The skill set is typical: php, javascript, html, css, ajax, wordpress, zencart, a little Joomla, a little smarty and a little framework. I've got about 2 years experience, but I do all the work on my websites and am hired regularly to fix other websites. Margaret Michele Waldman Sovereign Sites L.L.C. Website Development 646-861-3375 Rule your domain ... From mmwaldman at nyc.rr.com Tue Jun 23 11:46:05 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Tue, 23 Jun 2009 11:46:05 -0400 Subject: [nycphp-talk] [JOB] Part-time Work - Updated Message-ID: <20090623154605876.OSUG17858@hrndva-omta02.mail.rr.com> My company is or I am available for a regular part-time gig. Preferably 20 hours a week. No more than 30 hours a week. (On occasion, I could make exception and work more hours, but not on a regular basis.) My company charges ridiculously low rates, plus I pick-up all the payroll taxes. Now that's a good deal. If I were an employee, I have an unusual fringe benefit requirement, but my salary request would be lower than scale. So, if you need regular work but don't need a full-time employee or company, I'm available. The skill set is typical: php, javascript, html, css, ajax, wordpress, Zencart, a little Joomla, a little smarty and a little framework. I've got about 2 years experience, but I do all the work on my websites and am hired regularly to fix other websites. I am available to work on site if below 42 street or in Jersey city. If I seem to have a lot of demands for someone looking for work that's because I already have work. I'm just putting my feelers out. Bloomberg won't give me a reference, but in my six month review all that had to say was "Where do you get your integrity?" Margaret Michele Waldman Sovereign Sites L.L.C. Website Development 646-861-3375 Rule your domain ... From dorgan at donaldorgan.com Wed Jun 24 11:37:22 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Wed, 24 Jun 2009 11:37:22 -0400 (EDT) Subject: [nycphp-talk] Magento Message-ID: <4903404.1201245857842131.JavaMail.root@twoguyshosting.com.> Does anyone on the list have experience with Magento?? If so more specifically with adding a step to the checkout process? -------------- next part -------------- An HTML attachment was scrubbed... URL: From monalisa20042006 at gmail.com Wed Jun 24 12:27:45 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Wed, 24 Jun 2009 19:27:45 +0300 Subject: [nycphp-talk] Magento In-Reply-To: <4903404.1201245857842131.JavaMail.root@twoguyshosting.com.> References: <4903404.1201245857842131.JavaMail.root@twoguyshosting.com.> Message-ID: hhhhhhhhhhh it's me just doing that or in fact finished that lately Mona Web Developer Development Group On Wed, Jun 24, 2009 at 6:37 PM, Donald J. Organ IV wrote: > Does anyone on the list have experience with Magento?? If so more > specifically with adding a step to the checkout process? > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorgan at donaldorgan.com Wed Jun 24 12:31:14 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Wed, 24 Jun 2009 12:31:14 -0400 (EDT) Subject: [nycphp-talk] Magento In-Reply-To: Message-ID: <7299047.1251245861074372.JavaMail.root@twoguyshosting.com.> Would you mind sharing the module?? ----- Original Message ----- From: "Mona Borham" To: "NYPHP Talk" Sent: Wednesday, June 24, 2009 12:27:45 PM Subject: Re: [nycphp-talk] Magento hhhhhhhhhhh it's me just doing that or in fact finished that lately Mona Web Developer Development Group On Wed, Jun 24, 2009 at 6:37 PM, Donald J. Organ IV < dorgan at donaldorgan.com > wrote: Does anyone on the list have experience with Magento?? If so more specifically with adding a step to the checkout process? _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Jun 24 13:26:27 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 24 Jun 2009 13:26:27 -0400 (EDT) Subject: [nycphp-talk] Magento In-Reply-To: <4903404.1201245857842131.JavaMail.root@twoguyshosting.com.> Message-ID: On Wed, 24 Jun 2009, Donald J. Organ IV wrote: > Does anyone on the list have experience with Magento?? If so more specifically with adding a step to the checkout process? Please, NO HTML email on the list! -- Aj. From dorgan at donaldorgan.com Wed Jun 24 14:05:36 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Wed, 24 Jun 2009 14:05:36 -0400 (EDT) Subject: [nycphp-talk] Magento In-Reply-To: <7299047.1251245861074372.JavaMail.root@twoguyshosting.com.> Message-ID: <32991047.1311245866736021.JavaMail.root@twoguyshosting.com.> you can email it to me off the list if you like ----- Original Message ----- From: "Donald J. Organ IV" To: "NYPHP Talk" Sent: Wednesday, June 24, 2009 12:31:14 PM Subject: Re: [nycphp-talk] Magento Would you mind sharing the module?? ----- Original Message ----- From: "Mona Borham" To: "NYPHP Talk" Sent: Wednesday, June 24, 2009 12:27:45 PM Subject: Re: [nycphp-talk] Magento hhhhhhhhhhh it's me just doing that or in fact finished that lately Mona Web Developer Development Group On Wed, Jun 24, 2009 at 6:37 PM, Donald J. Organ IV < dorgan at donaldorgan.com > wrote: Does anyone on the list have experience with Magento?? If so more specifically with adding a step to the checkout process? _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php From kstigs at gmail.com Thu Jun 25 16:02:20 2009 From: kstigs at gmail.com (Kevin Castiglia) Date: Thu, 25 Jun 2009 16:02:20 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO Message-ID: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> Hello all, I am trying to decide whether to use MDB2 or PHP PDO. I am sort of leaning towards using PHP PDO at the moment, but I'd rather ask some experts on their opinion. Just fyi, I am using PHP 5.2.6-1+lenny3 and mySQL on a Linux server, I have created a table of about 20 fields and loaded 20,000 rows of data into the table. I then ran a select with a where clause and an update on every row, while testing performance of MDB2 and PHP PDO. I also tested whether a raw statement query to the server would be faster than forming a prepare statement and then executing using both MDB2 and PHP PDO. In my tests I found that using raw statements in MDB2 and PHP PDO is faster than using a prepare statement and then executing it for each row (raw statement was much faster using MDB2 and only slightly faster using PHP PDO). To capture the times I issued a microtime() just before the query/execute and just after. For processing 20,000 transactions: Here are my results for the MDB2 raw Select php program: - ran for 10.1 seconds vs 17.7 seconds for the prepare. The MDB2 raw update ran for 12.3 seconds vs 20.3 seconds for the MDB2 prepare. Here are my results for the PDO raw Select PHP program: - ran for 8.3 seconds vs 8.3 seconds for the prepare. The PDO raw update ran for 5.78 seconds vs 5.92 seconds for the PDO prepare. I have pasted two of my programs' source code: the first uses prepares and MDB2 and the second uses prepares and PHP PDO. ****I was told that using a prepare is much faster then using raw sql but my test results prove otherwise. Why is the prepare and execute method is slower than building the statement manually and querying the server? Shouldn't the prepare and execute method be faster since you only need to generate the prepare once as opposed to generating the statements within a loop? -Kevin 'mysql', 'username' => 'u1', 'password' => 'p1', 'hostspec' => 'localhost', 'database' => 'demo', ); $mdb2 =& MDB2::connect($arrDsn); $seqno = 0; //for normal prepare $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; $time_start = getmicrotime(); $sth1 = $mdb2->prepare($sql1, MDB2_PREPARE_RESULT); $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = ?'; $arrType = array('text','integer'); $sth2 = $mdb2->prepare($sql2, $arrType, MDB2_PREPARE_MANIP); while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ if($seqno == 0){ $x= count($inrec); $arrFields = array(); for ($y = 0; $y < $x; $y++) { $arrFields[$inrec[$y]] = $y; //creates associative array that associates fields with the index in $inrec } echo "Array of Field Names From Header Record in Input data is \n"; print_r($arrFields); $seqno++; continue; } $key = 0+$inrec[$arrFields['Unique #']]; //for normal prepare $values = array($key); $time_start1 = getmicrotime(); $affectedRows =& $sth1->execute($values); $arrCnt['select'] += getmicrotime() - $time_start1; $time_elapsed = getmicrotime() - $time_start; if (PEAR::isError($res)) { die($res->getMessage()); } $values = array(); $values = array('Kevin',$key); $time_start1 = getmicrotime(); $affectedRows =& $sth2->execute($values); $arrCnt['update'] += getmicrotime() - $time_start1; $time_elapsed = getmicrotime() - $time_start; if (PEAR::isError($res)) { die($res->getMessage()); } if($seqno > 20000) break; $seqno++; } echo "total: ". $time_elapsed."\n"; echo "execution times:\n"; var_dump($arrCnt); $rate = $time_elapsed / $seqno; echo "rate: ".$rate."\n"; // *************** // Calculate the time including fractions of a second // *************** function getmicrotime() { $mtime = microtime(); $mtime = explode(' ', $mtime); return($mtime[1] + $mtime[0]); } fclose($fpiDataAddr) or die("can not close data file"); $mdb2->disconnect(); ?> ------------------------------------------------------------------------------------------------------------ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------------------------------------ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------------------------------------ prepare($sql1); $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = ?'; $sth2 = $connHandle->prepare($sql2); while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ if($seqno == 0){ $x= count($inrec); $arrFields = array(); for ($y = 0; $y < $x; $y++) { $arrFields[$inrec[$y]] = $y; //creates associative array that associates fields with the index in $inrec } $seqno++; continue; } $key = 0+$inrec[$arrFields['Unique #']]; //for normal prepare $values = array($key); $time_start1 = getmicrotime(); $affectedRows =& $sth1->execute($values); $arrCnt['select'] += getmicrotime() - $time_start1; $time_elapsed = getmicrotime() - $time_start; if (PEAR::isError($res)) { die($res->getMessage()); } $values = array(); $values = array('Kevin',$key); $time_start1 = getmicrotime(); $affectedRows =& $sth2->execute($values); $arrCnt['update'] += getmicrotime() - $time_start1; $time_elapsed = getmicrotime() - $time_start; if (PEAR::isError($res)) { die($res->getMessage()); } if($seqno > 20000) break; $seqno++; } echo "total: ". $time_elapsed."\n"; echo "execution times:\n"; var_dump($arrCnt); $rate = $time_elapsed / $seqno; echo "rate: ".$rate."\n"; // *************** // Calculate the time including fractions of a second // *************** function getmicrotime() { $mtime = microtime(); $mtime = explode(' ', $mtime); return($mtime[1] + $mtime[0]); } fclose($fpiDataAddr) or die("can not close data file"); //disconnect $connHandle = null; ?> -------------- next part -------------- An HTML attachment was scrubbed... URL: From craigs.nyc.eugene at gmail.com Thu Jun 25 17:28:48 2009 From: craigs.nyc.eugene at gmail.com (Eugene Jen) Date: Thu, 25 Jun 2009 17:28:48 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> Message-ID: <4A43EC10.7060401@gmail.com> From the result of your benchmark, I think I need to trace the PDO, MDB source. It is very possible PDO and MDB doesn't do MySQL server side prepared statement, which will increased the performance. PDO and MDB may just emulate JDBC doing fake client side prepared statement, which will not increase the speed for each query. But I guess until I look a PDO and MDB, my answer is just a guess. Eugene Jen Kevin Castiglia wrote: > Hello all, > > I am trying to decide whether to use MDB2 or PHP PDO. I am sort of > leaning towards using PHP PDO at the moment, but I'd rather ask some > experts on their opinion. Just fyi, I am using PHP 5.2.6-1+lenny3 and > mySQL on a Linux server, I have created a table of about 20 fields and > loaded 20,000 rows of data into the table. I then ran a select with a > where clause and an update on every row, while testing performance of > MDB2 and PHP PDO. I also tested whether a raw statement query to the > server would be faster than forming a prepare statement and then > executing using both MDB2 and PHP PDO. > > In my tests I found that using raw statements in MDB2 and PHP PDO is > faster than using a prepare statement and then executing it for each > row (raw statement was much faster using MDB2 and only slightly faster > using PHP PDO). To capture the times I issued a microtime() just > before the query/execute and just after. > > For processing 20,000 transactions: > > Here are my results for the MDB2 raw Select php program: > > - ran for 10.1 seconds vs 17.7 seconds for the prepare. The MDB2 raw > update ran for 12.3 seconds vs 20.3 seconds for the MDB2 prepare. > > Here are my results for the PDO raw Select PHP program: > > - ran for 8.3 seconds vs 8.3 seconds for the prepare. The PDO raw > update ran for 5.78 seconds vs 5.92 seconds for the PDO prepare. > > I have pasted two of my programs' source code: the first uses prepares > and MDB2 and the second uses prepares and PHP PDO. > > *//**//*I was told that using a prepare is much faster then using raw > sql but my test results prove otherwise. Why is the prepare and > execute method is slower than building the statement manually and > querying the server? Shouldn't the prepare and execute method be > faster since you only need to generate the prepare once as opposed to > generating the statements within a loop? > > -Kevin > > > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In > File "); > ini_set('memory_limit', -1); > require_once('MDB2.php'); > //Connect to the Database > $arrDsn = array( > 'phptype' => 'mysql', > 'username' => 'u1', > 'password' => 'p1', > 'hostspec' => 'localhost', > 'database' => 'demo', > ); > $mdb2 =& MDB2::connect($arrDsn); > > $seqno = 0; > > > //for normal prepare > $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; > > $time_start = getmicrotime(); > $sth1 = $mdb2->prepare($sql1, MDB2_PREPARE_RESULT); > > $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM > = ?'; > $arrType = array('text','integer'); > $sth2 = $mdb2->prepare($sql2, $arrType, MDB2_PREPARE_MANIP); > > > while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ > > if($seqno == 0){ > $x= count($inrec); > $arrFields = array(); > for ($y = 0; $y < $x; $y++) { > $arrFields[$inrec[$y]] = $y; //creates associative array > that associates fields with the index in $inrec > } > > echo "Array of Field Names From Header Record in Input data is > \n"; > print_r($arrFields); > $seqno++; > continue; } > > > $key = 0+$inrec[$arrFields['Unique #']]; > //for normal prepare > $values = array($key); > > $time_start1 = getmicrotime(); > $affectedRows =& $sth1->execute($values); > $arrCnt['select'] += getmicrotime() - $time_start1; > > $time_elapsed = getmicrotime() - $time_start; > > if (PEAR::isError($res)) { > die($res->getMessage()); > } > > $values = array(); > $values = array('Kevin',$key); > > $time_start1 = getmicrotime(); > $affectedRows =& $sth2->execute($values); > $arrCnt['update'] += getmicrotime() - $time_start1; > $time_elapsed = getmicrotime() - $time_start; > > if (PEAR::isError($res)) { > die($res->getMessage()); > } > > if($seqno > 20000) break; > $seqno++; > } > > echo "total: ". $time_elapsed."\n"; > echo "execution times:\n"; > var_dump($arrCnt); > $rate = $time_elapsed / $seqno; > echo "rate: ".$rate."\n"; > > // *************** > // Calculate the time including fractions of a second > // *************** > function getmicrotime() { > $mtime = microtime(); > $mtime = explode(' ', $mtime); > return($mtime[1] + $mtime[0]); > } > > fclose($fpiDataAddr) or die("can not close data file"); > > $mdb2->disconnect(); > > ?> > > ------------------------------------------------------------------------------------------------------------ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ------------------------------------------------------------------------------------------------------------ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ------------------------------------------------------------------------------------------------------------ > > > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In > File "); > ini_set('memory_limit', -1); > > //Connect to the Database > $dsn = 'mysql:host=localhost;dbname=demo'; > > $connHandle = new PDO ($dsn,'u1',''); > > $seqno = 0; > $time_start = getmicrotime(); > > //for normal prepare > $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; > > $sth1 = $connHandle->prepare($sql1); > > $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM > = ?'; > $sth2 = $connHandle->prepare($sql2); > > while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ > > if($seqno == 0){ > $x= count($inrec); > $arrFields = array(); > for ($y = 0; $y < $x; $y++) { > $arrFields[$inrec[$y]] = $y; //creates associative array > that associates fields with the index in $inrec > } > > $seqno++; > continue; } > > > $key = 0+$inrec[$arrFields['Unique #']]; > //for normal prepare > $values = array($key); > > $time_start1 = getmicrotime(); > $affectedRows =& $sth1->execute($values); > $arrCnt['select'] += getmicrotime() - $time_start1; > > $time_elapsed = getmicrotime() - $time_start; > > if (PEAR::isError($res)) { > die($res->getMessage()); > } > > $values = array(); > $values = array('Kevin',$key); > > $time_start1 = getmicrotime(); > $affectedRows =& $sth2->execute($values); > $arrCnt['update'] += getmicrotime() - $time_start1; > $time_elapsed = getmicrotime() - $time_start; > > if (PEAR::isError($res)) { > die($res->getMessage()); > } > > > > if($seqno > 20000) break; > $seqno++; > } > > echo "total: ". $time_elapsed."\n"; > echo "execution times:\n"; > var_dump($arrCnt); > $rate = $time_elapsed / $seqno; > echo "rate: ".$rate."\n"; > > // *************** > // Calculate the time including fractions of a second > // *************** > function getmicrotime() { > $mtime = microtime(); > $mtime = explode(' ', $mtime); > return($mtime[1] + $mtime[0]); > } > > fclose($fpiDataAddr) or die("can not close data file"); > > //disconnect > $connHandle = null; > > ?> > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Thu Jun 25 17:38:20 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 25 Jun 2009 17:38:20 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> Message-ID: <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> > I was told that using a prepare is much faster then using raw sql but my > test results prove otherwise. Why is the prepare and execute method is > slower than building the statement manually and querying the server? The "prepare is faster" lie was started as a conspiracy to trick the idiots into using prepared statement for security reasons. Prepared statements are typically twice as slow because you have to talk to the database twice, and in your case, they are about the same as not using a prepared since you are doing repeated queries. >From your data, it looks like MDB2 is probably doing something stupid under the hood and possibly re-preparing in each iteration. I think MDB2 and PDO offer some sort of "Emulate Prepared Statements" mode, and I would re-run your tests using that. Personally, I find PDO pointless, and MDB2 overkill. Any reason you are ruling out mysqli? Regards, John Campbell > ??? ??? } > > ??? ??? echo "Array of Field Names From Header Record in Input data is \n"; > ??? ??? print_r($arrFields); > ??? ??? $seqno++; > ??? ??? continue;??? } > > > ??? ??? $key = 0+$inrec[$arrFields['Unique #']]; > ??? ??? //for normal prepare > ??? ??? $values = array($key); > > ??? ??? $time_start1 = getmicrotime(); > ??? ??? $affectedRows =& $sth1->execute($values); > ??? ??? $arrCnt['select'] += getmicrotime() - $time_start1; > > ??? ??? $time_elapsed = getmicrotime() - $time_start; > > ??? ??? if (PEAR::isError($res)) { > ??? ??? ??? die($res->getMessage()); > ??? ??? } > > ??? ??? $values = array(); > ??? ??? $values = array('Kevin',$key); > > ??? ??? $time_start1 = getmicrotime(); > ??? ??? $affectedRows =& $sth2->execute($values); > ??? ??? $arrCnt['update'] += getmicrotime() - $time_start1; > ??? ??? $time_elapsed = getmicrotime() - $time_start; > > ??? ??? if (PEAR::isError($res)) { > ??? ??? ??? die($res->getMessage()); > ??? ??? } > > ??? ??? if($seqno > 20000) break; > ??? ??? $seqno++; > } > > echo "total: ". $time_elapsed."\n"; > echo "execution times:\n"; > var_dump($arrCnt); > $rate = $time_elapsed / $seqno; > echo "rate: ".$rate."\n"; > > ??? // *************** > ??? // Calculate the time including fractions of a second > ??? // *************** > ??? function getmicrotime() { > ??????? $mtime = microtime(); > ??????? $mtime = explode(' ', $mtime); > ??????? return($mtime[1] + $mtime[0]); > ??? } > > fclose($fpiDataAddr) or die("can not close data file"); > > $mdb2->disconnect(); > > ?> > > ------------------------------------------------------------------------------------------------------------ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ------------------------------------------------------------------------------------------------------------ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ------------------------------------------------------------------------------------------------------------ > > > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In File > "); > ini_set('memory_limit', -1); > > //Connect to the Database > $dsn = 'mysql:host=localhost;dbname=demo'; > > $connHandle = new PDO ($dsn,'u1',''); > > $seqno = 0; > $time_start = getmicrotime(); > > ??? ??? //for normal prepare > ??? ??? $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; > ??? ??? $sth1 = $connHandle->prepare($sql1); > > ??? ??? $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = ?'; > ??? ??? $sth2 = $connHandle->prepare($sql2); > > while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ > > ??? ??? if($seqno == 0){ > ??? ??? $x= count($inrec); > ??? ??? $arrFields = array(); > ??? ??? for ($y = 0; $y < $x; $y++) { > ??? ??? ??? $arrFields[$inrec[$y]] = $y; //creates associative array that > associates fields with the index in $inrec > ??? ??? } > > ??? ??? $seqno++; > ??? ??? continue;??? } > > > ??? ??? $key = 0+$inrec[$arrFields['Unique #']]; > ??? ??? //for normal prepare > ??? ??? $values = array($key); > > ??? ??? $time_start1 = getmicrotime(); > ??? ??? $affectedRows =& $sth1->execute($values); > ??? ??? $arrCnt['select'] += getmicrotime() - $time_start1; > > ??? ??? $time_elapsed = getmicrotime() - $time_start; > > ??? ??? if (PEAR::isError($res)) { > ??? ??? ??? die($res->getMessage()); > ??? ??? } > > ??? ??? $values = array(); > ??? ??? $values = array('Kevin',$key); > > ??? ??? $time_start1 = getmicrotime(); > ??? ??? $affectedRows =& $sth2->execute($values); > ??? ??? $arrCnt['update'] += getmicrotime() - $time_start1; > ??? ??? $time_elapsed = getmicrotime() - $time_start; > > ??? ??? if (PEAR::isError($res)) { > ??? ??? ??? die($res->getMessage()); > ??? ??? } > > > > ??? ??? if($seqno > 20000) break; > ??? ??? $seqno++; > } > > echo "total: ". $time_elapsed."\n"; > echo "execution times:\n"; > var_dump($arrCnt); > $rate = $time_elapsed / $seqno; > echo "rate: ".$rate."\n"; > > ??? // *************** > ??? // Calculate the time including fractions of a second > ??? // *************** > ??? function getmicrotime() { > ??????? $mtime = microtime(); > ??????? $mtime = explode(' ', $mtime); > ??????? return($mtime[1] + $mtime[0]); > ??? } > > fclose($fpiDataAddr) or die("can not close data file"); > > //disconnect > $connHandle = null; > > ?> > > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From oorza2k5 at gmail.com Thu Jun 25 17:44:38 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Thu, 25 Jun 2009 17:44:38 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> Message-ID: <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> On Thu, Jun 25, 2009 at 5:38 PM, John Campbell wrote: >> I was told that using a prepare is much faster then using raw sql but my >> test results prove otherwise. Why is the prepare and execute method is >> slower than building the statement manually and querying the server? > > The "prepare is faster" lie was started as a conspiracy to trick the > idiots into using prepared statement for security reasons. ?Prepared > statements are typically twice as slow because you have to talk to the > database twice, and in your case, they are about the same as not using > a prepared since you are doing repeated queries. > > >From your data, it looks like MDB2 is probably doing something stupid > under the hood and possibly re-preparing in each iteration. > > I think MDB2 and PDO offer some sort of "Emulate Prepared Statements" > mode, and I would re-run your tests using that. > > Personally, I find PDO pointless, and MDB2 overkill. ?Any reason you > are ruling out mysqli? > > Regards, > John Campbell > >> ??? ??? } >> >> ??? ??? echo "Array of Field Names From Header Record in Input data is \n"; >> ??? ??? print_r($arrFields); >> ??? ??? $seqno++; >> ??? ??? continue;??? } >> >> >> ??? ??? $key = 0+$inrec[$arrFields['Unique #']]; >> ??? ??? //for normal prepare >> ??? ??? $values = array($key); >> >> ??? ??? $time_start1 = getmicrotime(); >> ??? ??? $affectedRows =& $sth1->execute($values); >> ??? ??? $arrCnt['select'] += getmicrotime() - $time_start1; >> >> ??? ??? $time_elapsed = getmicrotime() - $time_start; >> >> ??? ??? if (PEAR::isError($res)) { >> ??? ??? ??? die($res->getMessage()); >> ??? ??? } >> >> ??? ??? $values = array(); >> ??? ??? $values = array('Kevin',$key); >> >> ??? ??? $time_start1 = getmicrotime(); >> ??? ??? $affectedRows =& $sth2->execute($values); >> ??? ??? $arrCnt['update'] += getmicrotime() - $time_start1; >> ??? ??? $time_elapsed = getmicrotime() - $time_start; >> >> ??? ??? if (PEAR::isError($res)) { >> ??? ??? ??? die($res->getMessage()); >> ??? ??? } >> >> ??? ??? if($seqno > 20000) break; >> ??? ??? $seqno++; >> } >> >> echo "total: ". $time_elapsed."\n"; >> echo "execution times:\n"; >> var_dump($arrCnt); >> $rate = $time_elapsed / $seqno; >> echo "rate: ".$rate."\n"; >> >> ??? // *************** >> ??? // Calculate the time including fractions of a second >> ??? // *************** >> ??? function getmicrotime() { >> ??????? $mtime = microtime(); >> ??????? $mtime = explode(' ', $mtime); >> ??????? return($mtime[1] + $mtime[0]); >> ??? } >> >> fclose($fpiDataAddr) or die("can not close data file"); >> >> $mdb2->disconnect(); >> >> ?> >> >> ------------------------------------------------------------------------------------------------------------ >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ------------------------------------------------------------------------------------------------------------ >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ------------------------------------------------------------------------------------------------------------ >> >> >> > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In File >> "); >> ini_set('memory_limit', -1); >> >> //Connect to the Database >> $dsn = 'mysql:host=localhost;dbname=demo'; >> >> $connHandle = new PDO ($dsn,'u1',''); >> >> $seqno = 0; >> $time_start = getmicrotime(); >> >> ??? ??? //for normal prepare >> ??? ??? $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; >> ??? ??? $sth1 = $connHandle->prepare($sql1); >> >> ??? ??? $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = ?'; >> ??? ??? $sth2 = $connHandle->prepare($sql2); >> >> while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ >> >> ??? ??? if($seqno == 0){ >> ??? ??? $x= count($inrec); >> ??? ??? $arrFields = array(); >> ??? ??? for ($y = 0; $y < $x; $y++) { >> ??? ??? ??? $arrFields[$inrec[$y]] = $y; //creates associative array that >> associates fields with the index in $inrec >> ??? ??? } >> >> ??? ??? $seqno++; >> ??? ??? continue;??? } >> >> >> ??? ??? $key = 0+$inrec[$arrFields['Unique #']]; >> ??? ??? //for normal prepare >> ??? ??? $values = array($key); >> >> ??? ??? $time_start1 = getmicrotime(); >> ??? ??? $affectedRows =& $sth1->execute($values); >> ??? ??? $arrCnt['select'] += getmicrotime() - $time_start1; >> >> ??? ??? $time_elapsed = getmicrotime() - $time_start; >> >> ??? ??? if (PEAR::isError($res)) { >> ??? ??? ??? die($res->getMessage()); >> ??? ??? } >> >> ??? ??? $values = array(); >> ??? ??? $values = array('Kevin',$key); >> >> ??? ??? $time_start1 = getmicrotime(); >> ??? ??? $affectedRows =& $sth2->execute($values); >> ??? ??? $arrCnt['update'] += getmicrotime() - $time_start1; >> ??? ??? $time_elapsed = getmicrotime() - $time_start; >> >> ??? ??? if (PEAR::isError($res)) { >> ??? ??? ??? die($res->getMessage()); >> ??? ??? } >> >> >> >> ??? ??? if($seqno > 20000) break; >> ??? ??? $seqno++; >> } >> >> echo "total: ". $time_elapsed."\n"; >> echo "execution times:\n"; >> var_dump($arrCnt); >> $rate = $time_elapsed / $seqno; >> echo "rate: ".$rate."\n"; >> >> ??? // *************** >> ??? // Calculate the time including fractions of a second >> ??? // *************** >> ??? function getmicrotime() { >> ??????? $mtime = microtime(); >> ??????? $mtime = explode(' ', $mtime); >> ??????? return($mtime[1] + $mtime[0]); >> ??? } >> >> fclose($fpiDataAddr) or die("can not close data file"); >> >> //disconnect >> $connHandle = null; >> >> ?> >> >> >> >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > Wait, are you advocating //against// prepared statements? It's a pretty well known fact, or at least I thought so, that MySQL doesn't cache prepared statement opcodes and must re-compile them every time ::execute() is called, whereas a better RDBMS (correct me if I'm wrong, I believe postgres does) will cache the prepared opcodes; granted, you're not going to see some great huge speed improvement unless you're running ridiculous queries that ought to be stored procedures anyhow. I still don't understand the hate for prepared statments, as they are inherently more secure and allow a greater flexibility with data type checks, as well as making your code look a whole hell of a lot cleaner if deployed properly. And why the hate for PDO? From eric.gewirtz at solutiononecdi.com Thu Jun 25 18:02:54 2009 From: eric.gewirtz at solutiononecdi.com (Eric Gewirtz) Date: Thu, 25 Jun 2009 18:02:54 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> Message-ID: Hi, I work with Kevin. Our application needs to run on both mySQL and Oracle so we are looking for portability. We currently are using PEAR DB and we are looking into moving to MDB2 or PDO so we thought it would be a good idea to test performance before we make a decision. Amazing what you find when you dig ... Thanks for the ideas and perspective SolutionOne Eric Gewirtz 162 Turk Hill Road Brewster NY, 10509 Phone: 845-729-7800 FAX: 845-279-5502 >-----Original Message----- >From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On >Behalf Of John Campbell >Sent: Thursday, June 25, 2009 5:38 PM >To: NYPHP Talk >Subject: Re: [nycphp-talk] Trying to decide between MDB2 and PHP PDO > >> I was told that using a prepare is much faster then using raw sql but my >> test results prove otherwise. Why is the prepare and execute method is >> slower than building the statement manually and querying the server? > >The "prepare is faster" lie was started as a conspiracy to trick the >idiots into using prepared statement for security reasons. Prepared >statements are typically twice as slow because you have to talk to the >database twice, and in your case, they are about the same as not using >a prepared since you are doing repeated queries. > >>From your data, it looks like MDB2 is probably doing something stupid >under the hood and possibly re-preparing in each iteration. > >I think MDB2 and PDO offer some sort of "Emulate Prepared Statements" >mode, and I would re-run your tests using that. > >Personally, I find PDO pointless, and MDB2 overkill. Any reason you >are ruling out mysqli? > >Regards, >John Campbell > >> ??? ??? } >> >> ??? ??? echo "Array of Field Names From Header Record in Input data is >\n"; >> ??? ??? print_r($arrFields); >> ??? ??? $seqno++; >> ??? ??? continue;??? } >> >> >> ??? ??? $key = 0+$inrec[$arrFields['Unique #']]; >> ??? ??? //for normal prepare >> ??? ??? $values = array($key); >> >> ??? ??? $time_start1 = getmicrotime(); >> ??? ??? $affectedRows =& $sth1->execute($values); >> ??? ??? $arrCnt['select'] += getmicrotime() - $time_start1; >> >> ??? ??? $time_elapsed = getmicrotime() - $time_start; >> >> ??? ??? if (PEAR::isError($res)) { >> ??? ??? ??? die($res->getMessage()); >> ??? ??? } >> >> ??? ??? $values = array(); >> ??? ??? $values = array('Kevin',$key); >> >> ??? ??? $time_start1 = getmicrotime(); >> ??? ??? $affectedRows =& $sth2->execute($values); >> ??? ??? $arrCnt['update'] += getmicrotime() - $time_start1; >> ??? ??? $time_elapsed = getmicrotime() - $time_start; >> >> ??? ??? if (PEAR::isError($res)) { >> ??? ??? ??? die($res->getMessage()); >> ??? ??? } >> >> ??? ??? if($seqno > 20000) break; >> ??? ??? $seqno++; >> } >> >> echo "total: ". $time_elapsed."\n"; >> echo "execution times:\n"; >> var_dump($arrCnt); >> $rate = $time_elapsed / $seqno; >> echo "rate: ".$rate."\n"; >> >> ??? // *************** >> ??? // Calculate the time including fractions of a second >> ??? // *************** >> ??? function getmicrotime() { >> ??????? $mtime = microtime(); >> ??????? $mtime = explode(' ', $mtime); >> ??????? return($mtime[1] + $mtime[0]); >> ??? } >> >> fclose($fpiDataAddr) or die("can not close data file"); >> >> $mdb2->disconnect(); >> >> ?> >> >> ------------------------------------------------------------------------- >----------------------------------- >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ------------------------------------------------------------------------- >----------------------------------- >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ------------------------------------------------------------------------- >----------------------------------- >> >> >> > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In >File >> "); >> ini_set('memory_limit', -1); >> >> //Connect to the Database >> $dsn = 'mysql:host=localhost;dbname=demo'; >> >> $connHandle = new PDO ($dsn,'u1',''); >> >> $seqno = 0; >> $time_start = getmicrotime(); >> >> ??? ??? //for normal prepare >> ??? ??? $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; >> ??? ??? $sth1 = $connHandle->prepare($sql1); >> >> ??? ??? $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = >?'; >> ??? ??? $sth2 = $connHandle->prepare($sql2); >> >> while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ >> >> ??? ??? if($seqno == 0){ >> ??? ??? $x= count($inrec); >> ??? ??? $arrFields = array(); >> ??? ??? for ($y = 0; $y < $x; $y++) { >> ??? ??? ??? $arrFields[$inrec[$y]] = $y; //creates associative array that >> associates fields with the index in $inrec >> ??? ??? } >> >> ??? ??? $seqno++; >> ??? ??? continue;??? } >> >> >> ??? ??? $key = 0+$inrec[$arrFields['Unique #']]; >> ??? ??? //for normal prepare >> ??? ??? $values = array($key); >> >> ??? ??? $time_start1 = getmicrotime(); >> ??? ??? $affectedRows =& $sth1->execute($values); >> ??? ??? $arrCnt['select'] += getmicrotime() - $time_start1; >> >> ??? ??? $time_elapsed = getmicrotime() - $time_start; >> >> ??? ??? if (PEAR::isError($res)) { >> ??? ??? ??? die($res->getMessage()); >> ??? ??? } >> >> ??? ??? $values = array(); >> ??? ??? $values = array('Kevin',$key); >> >> ??? ??? $time_start1 = getmicrotime(); >> ??? ??? $affectedRows =& $sth2->execute($values); >> ??? ??? $arrCnt['update'] += getmicrotime() - $time_start1; >> ??? ??? $time_elapsed = getmicrotime() - $time_start; >> >> ??? ??? if (PEAR::isError($res)) { >> ??? ??? ??? die($res->getMessage()); >> ??? ??? } >> >> >> >> ??? ??? if($seqno > 20000) break; >> ??? ??? $seqno++; >> } >> >> echo "total: ". $time_elapsed."\n"; >> echo "execution times:\n"; >> var_dump($arrCnt); >> $rate = $time_elapsed / $seqno; >> echo "rate: ".$rate."\n"; >> >> ??? // *************** >> ??? // Calculate the time including fractions of a second >> ??? // *************** >> ??? function getmicrotime() { >> ??????? $mtime = microtime(); >> ??????? $mtime = explode(' ', $mtime); >> ??????? return($mtime[1] + $mtime[0]); >> ??? } >> >> fclose($fpiDataAddr) or die("can not close data file"); >> >> //disconnect >> $connHandle = null; >> >> ?> >> >> >> >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> >_______________________________________________ >New York PHP User Group Community Talk Mailing List >http://lists.nyphp.org/mailman/listinfo/talk > >http://www.nyphp.org/show_participation.php From jcampbell1 at gmail.com Thu Jun 25 18:04:03 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 25 Jun 2009 18:04:03 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> Message-ID: <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> On Thu, Jun 25, 2009 at 5:44 PM, Eddie Drapkin wrote: > Wait, are you advocating //against// prepared statements? Not at all, but when using mysql, you should emulate them. I am actually all for "prepared" style queries, if I ever see "mysqli_real_escape_string" in someone's code, I immediately write the person off as clueless. > And why the hate for PDO? I don't see what it offers. It is too verbose for my taste: I like to be able to write: $posts = $db->sql("SELECT * FROM posts LIMIT ?,?",$offset,$length)->fetchAll(); To achieve this, I have to wrap whatever I am using, and I have found PDO to be slower and more buggy than mysqli. Regards, John Campbell From ashaw at polymerdb.org Thu Jun 25 18:39:39 2009 From: ashaw at polymerdb.org (Allen Shaw) Date: Thu, 25 Jun 2009 17:39:39 -0500 Subject: [nycphp-talk] "mysqli_real_escape_string" = clueless (was: Trying to decide between MDB2 and PHP PDO) In-Reply-To: <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> Message-ID: <4A43FCAB.7090608@polymerdb.org> John Campbell wrote: > if I ever see "mysqli_real_escape_string" in someone's code, I immediately write the > person off as clueless. > Clearly you're working a few levels above where I am, which is not saying much, to be fair. What techniques are we talking about here that make this function obsolete? Thanks, Allen -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From oorza2k5 at gmail.com Thu Jun 25 19:08:34 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Thu, 25 Jun 2009 19:08:34 -0400 Subject: [nycphp-talk] "mysqli_real_escape_string" = clueless (was: Trying to decide between MDB2 and PHP PDO) In-Reply-To: <4A43FCAB.7090608@polymerdb.org> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> <4A43FCAB.7090608@polymerdb.org> Message-ID: <68de37340906251608k7c462456w52b03d3751cd3ece@mail.gmail.com> parameterized queries! On Thu, Jun 25, 2009 at 6:39 PM, Allen Shaw wrote: > John Campbell wrote: >> >> if I ever see "mysqli_real_escape_string" in someone's code, I immediately >> write the >> person off as clueless. >> > > Clearly you're working a few levels above where I am, which is not saying > much, to be fair. > > What techniques are we talking about here that make this function obsolete? > > Thanks, > Allen > > -- > Allen Shaw > slidePresenter (http://slides.sourceforge.net) > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ashaw at polymerdb.org Thu Jun 25 19:33:05 2009 From: ashaw at polymerdb.org (Allen Shaw) Date: Thu, 25 Jun 2009 18:33:05 -0500 Subject: [nycphp-talk] "mysqli_real_escape_string" = clueless In-Reply-To: <68de37340906251608k7c462456w52b03d3751cd3ece@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> <4A43FCAB.7090608@polymerdb.org> <68de37340906251608k7c462456w52b03d3751cd3ece@mail.gmail.com> Message-ID: <4A440931.6040702@polymerdb.org> a.k.a. prepared statements? Okay, got it. Thanks much for the clue. Got some reading to do now... - A. Eddie Drapkin wrote: > parameterized queries! > > On Thu, Jun 25, 2009 at 6:39 PM, Allen Shaw wrote: > >> John Campbell wrote: >> >>> if I ever see "mysqli_real_escape_string" in someone's code, I immediately >>> write the >>> person off as clueless. >>> >>> >> Clearly you're working a few levels above where I am, which is not saying >> much, to be fair. >> >> What techniques are we talking about here that make this function obsolete? >> >> Thanks, >> Allen >> >> -- >> Allen Shaw >> slidePresenter (http://slides.sourceforge.net) >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> >> > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Allen Shaw slidePresenter (http://slides.sourceforge.net) From patrick at hexane.org Thu Jun 25 20:57:55 2009 From: patrick at hexane.org (Patrick May) Date: Thu, 25 Jun 2009 20:57:55 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <4A43EC10.7060401@gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <4A43EC10.7060401@gmail.com> Message-ID: i'd recommend adodb as your php db interface library: http://adodb.sourceforge.net/ On Thu, Jun 25, 2009 at 5:28 PM, Eugene Jen wrote: > >From the result of your benchmark, I think I need to trace the PDO, MDB > source. > It is very possible PDO and MDB doesn't do MySQL server side prepared > statement, which > will increased the performance. PDO and MDB may just emulate JDBC doing > fake client > side prepared statement, which will not increase the speed for each query. > > But I guess until I look a PDO and MDB, my answer is just a guess. > > Eugene Jen > > Kevin Castiglia wrote: > > Hello all, > > I am trying to decide whether to use MDB2 or PHP PDO. I am sort of leaning > towards using PHP PDO at the moment, but I'd rather ask some experts on > their opinion. Just fyi, I am using PHP 5.2.6-1+lenny3 and mySQL on a Linux > server, I have created a table of about 20 fields and loaded 20,000 rows of > data into the table. I then ran a select with a where clause and an update > on every row, while testing performance of MDB2 and PHP PDO. I also tested > whether a raw statement query to the server would be faster than forming a > prepare statement and then executing using both MDB2 and PHP PDO. > > In my tests I found that using raw statements in MDB2 and PHP PDO is faster > than using a prepare statement and then executing it for each row (raw > statement was much faster using MDB2 and only slightly faster using PHP > PDO). To capture the times I issued a microtime() just before the > query/execute and just after. > > For processing 20,000 transactions: > > Here are my results for the MDB2 raw Select php program: > > - ran for 10.1 seconds vs 17.7 seconds for the prepare. The MDB2 raw > update ran for 12.3 seconds vs 20.3 seconds for the MDB2 prepare. > > Here are my results for the PDO raw Select PHP program: > > - ran for 8.3 seconds vs 8.3 seconds for the prepare. The PDO raw update > ran for 5.78 seconds vs 5.92 seconds for the PDO prepare. > > I have pasted two of my programs' source code: the first uses prepares and > MDB2 and the second uses prepares and PHP PDO. > > ****I was told that using a prepare is much faster then using raw sql but > my test results prove otherwise. Why is the prepare and execute method is > slower than building the statement manually and querying the server? > Shouldn't the prepare and execute method be faster since you only need to > generate the prepare once as opposed to generating the statements within a > loop? > -Kevin > > > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In File > "); > ini_set('memory_limit', -1); > require_once('MDB2.php'); > //Connect to the Database > $arrDsn = array( > 'phptype' => 'mysql', > 'username' => 'u1', > 'password' => 'p1', > 'hostspec' => 'localhost', > 'database' => 'demo', > ); > $mdb2 =& MDB2::connect($arrDsn); > > $seqno = 0; > > > //for normal prepare > $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; > > $time_start = getmicrotime(); > $sth1 = $mdb2->prepare($sql1, MDB2_PREPARE_RESULT); > > $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = ?'; > > $arrType = array('text','integer'); > $sth2 = $mdb2->prepare($sql2, $arrType, MDB2_PREPARE_MANIP); > > > while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ > > if($seqno == 0){ > $x= count($inrec); > $arrFields = array(); > for ($y = 0; $y < $x; $y++) { > $arrFields[$inrec[$y]] = $y; //creates associative array that > associates fields with the index in $inrec > } > > echo "Array of Field Names From Header Record in Input data is \n"; > print_r($arrFields); > $seqno++; > continue; } > > > $key = 0+$inrec[$arrFields['Unique #']]; > //for normal prepare > $values = array($key); > > $time_start1 = getmicrotime(); > $affectedRows =& $sth1->execute($values); > $arrCnt['select'] += getmicrotime() - $time_start1; > > $time_elapsed = getmicrotime() - $time_start; > > if (PEAR::isError($res)) { > die($res->getMessage()); > } > > $values = array(); > $values = array('Kevin',$key); > > $time_start1 = getmicrotime(); > $affectedRows =& $sth2->execute($values); > $arrCnt['update'] += getmicrotime() - $time_start1; > $time_elapsed = getmicrotime() - $time_start; > > if (PEAR::isError($res)) { > die($res->getMessage()); > } > > if($seqno > 20000) break; > $seqno++; > } > > echo "total: ". $time_elapsed."\n"; > echo "execution times:\n"; > var_dump($arrCnt); > $rate = $time_elapsed / $seqno; > echo "rate: ".$rate."\n"; > > // *************** > // Calculate the time including fractions of a second > // *************** > function getmicrotime() { > $mtime = microtime(); > $mtime = explode(' ', $mtime); > return($mtime[1] + $mtime[0]); > } > > fclose($fpiDataAddr) or die("can not close data file"); > > $mdb2->disconnect(); > > ?> > > > ------------------------------------------------------------------------------------------------------------ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ------------------------------------------------------------------------------------------------------------ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ------------------------------------------------------------------------------------------------------------ > > > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In File > "); > ini_set('memory_limit', -1); > > //Connect to the Database > $dsn = 'mysql:host=localhost;dbname=demo'; > > $connHandle = new PDO ($dsn,'u1',''); > > $seqno = 0; > $time_start = getmicrotime(); > > //for normal prepare > $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; > > $sth1 = $connHandle->prepare($sql1); > > $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = ?'; > > $sth2 = $connHandle->prepare($sql2); > > while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ > > if($seqno == 0){ > $x= count($inrec); > $arrFields = array(); > for ($y = 0; $y < $x; $y++) { > $arrFields[$inrec[$y]] = $y; //creates associative array that > associates fields with the index in $inrec > } > > $seqno++; > continue; } > > > $key = 0+$inrec[$arrFields['Unique #']]; > //for normal prepare > $values = array($key); > > $time_start1 = getmicrotime(); > $affectedRows =& $sth1->execute($values); > $arrCnt['select'] += getmicrotime() - $time_start1; > > $time_elapsed = getmicrotime() - $time_start; > > if (PEAR::isError($res)) { > die($res->getMessage()); > } > > $values = array(); > $values = array('Kevin',$key); > > $time_start1 = getmicrotime(); > $affectedRows =& $sth2->execute($values); > $arrCnt['update'] += getmicrotime() - $time_start1; > $time_elapsed = getmicrotime() - $time_start; > > if (PEAR::isError($res)) { > die($res->getMessage()); > } > > > > if($seqno > 20000) break; > $seqno++; > } > > echo "total: ". $time_elapsed."\n"; > echo "execution times:\n"; > var_dump($arrCnt); > $rate = $time_elapsed / $seqno; > echo "rate: ".$rate."\n"; > > // *************** > // Calculate the time including fractions of a second > // *************** > function getmicrotime() { > $mtime = microtime(); > $mtime = explode(' ', $mtime); > return($mtime[1] + $mtime[0]); > } > > fclose($fpiDataAddr) or die("can not close data file"); > > //disconnect > $connHandle = null; > > ?> > > > > > > ------------------------------ > > _______________________________________________ > New York PHP User Group Community Talk Mailing Listhttp://lists.nyphp.org/mailman/listinfo/talk > http://www.nyphp.org/show_participation.php > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Patrick May +1 (347) 232-5208 -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrick at hexane.org Thu Jun 25 21:01:32 2009 From: patrick at hexane.org (Patrick May) Date: Thu, 25 Jun 2009 21:01:32 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <4A43EC10.7060401@gmail.com> Message-ID: Mainly b/c of it's variety of supported query types. it's quite nice. Notice the seamless and consistent parameter escaping as well. ~ p -- include('/path/to/adodb.inc.php'); $DB = NewADOConnection('mysql'); $DB->Connect($server, $user, $pwd, $db); # M'soft style data retrieval with binds $rs = $DB->Execute("select * from table where key=?",array($key)); while (!$rs->EOF) { print_r($rs->fields); $rs->MoveNext(); } # PEAR style data retrieval $rs = $DB->Execute("select * from table where key=123"); while ($array = $rs->FetchRow()) { print_r($array); } # Alternative URI connection syntax: $DB = NewADOConnection("*mysql://$user:$pwd@$server/$db?persist*"); # No need for Connect or PConnect when using URI syntax $ok = $DB->Execute("update atable set aval = 0"); if (!$ok) mylogerr($DB->ErrorMsg()); # Updating tables $ok = $DB->Execute("update table set col1=? where key=?",array($colval, $key)); # retrieving data shortcuts $val = $DB->GetOne("select col from table where key='John'"); $row = $DB->GetRow("select col from table where key='John'"); $arr = $DB->GetAll("select col from table"); $arr = $DB->GetAssoc("select key,col from table"); # returns associative array $key=>col $val = $DB->GetCol("select col from table"); # returns array of col # Retrieve high speed cached recordsets (cached for 3600 secs) # Cache directory defined in global $ADODB_CACHE_DIR. # CacheGetOne, CacheRow, CacheGetAll all work $rs = $DB->CacheExecute(3600, "select orgname from users where user='JOHN'"); On Thu, Jun 25, 2009 at 8:57 PM, Patrick May wrote: > i'd recommend adodb as your php db interface library: > > http://adodb.sourceforge.net/ > > > > On Thu, Jun 25, 2009 at 5:28 PM, Eugene Jen wrote: > >> >From the result of your benchmark, I think I need to trace the PDO, MDB >> source. >> It is very possible PDO and MDB doesn't do MySQL server side prepared >> statement, which >> will increased the performance. PDO and MDB may just emulate JDBC doing >> fake client >> side prepared statement, which will not increase the speed for each query. >> >> But I guess until I look a PDO and MDB, my answer is just a guess. >> >> Eugene Jen >> >> Kevin Castiglia wrote: >> >> Hello all, >> >> I am trying to decide whether to use MDB2 or PHP PDO. I am sort of leaning >> towards using PHP PDO at the moment, but I'd rather ask some experts on >> their opinion. Just fyi, I am using PHP 5.2.6-1+lenny3 and mySQL on a Linux >> server, I have created a table of about 20 fields and loaded 20,000 rows of >> data into the table. I then ran a select with a where clause and an update >> on every row, while testing performance of MDB2 and PHP PDO. I also tested >> whether a raw statement query to the server would be faster than forming a >> prepare statement and then executing using both MDB2 and PHP PDO. >> >> In my tests I found that using raw statements in MDB2 and PHP PDO is >> faster than using a prepare statement and then executing it for each row >> (raw statement was much faster using MDB2 and only slightly faster using PHP >> PDO). To capture the times I issued a microtime() just before the >> query/execute and just after. >> >> For processing 20,000 transactions: >> >> Here are my results for the MDB2 raw Select php program: >> >> - ran for 10.1 seconds vs 17.7 seconds for the prepare. The MDB2 raw >> update ran for 12.3 seconds vs 20.3 seconds for the MDB2 prepare. >> >> Here are my results for the PDO raw Select PHP program: >> >> - ran for 8.3 seconds vs 8.3 seconds for the prepare. The PDO raw update >> ran for 5.78 seconds vs 5.92 seconds for the PDO prepare. >> >> I have pasted two of my programs' source code: the first uses prepares and >> MDB2 and the second uses prepares and PHP PDO. >> >> ****I was told that using a prepare is much faster then using raw sql but >> my test results prove otherwise. Why is the prepare and execute method is >> slower than building the statement manually and querying the server? >> Shouldn't the prepare and execute method be faster since you only need to >> generate the prepare once as opposed to generating the statements within a >> loop? >> -Kevin >> >> >> > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In >> File "); >> ini_set('memory_limit', -1); >> require_once('MDB2.php'); >> //Connect to the Database >> $arrDsn = array( >> 'phptype' => 'mysql', >> 'username' => 'u1', >> 'password' => 'p1', >> 'hostspec' => 'localhost', >> 'database' => 'demo', >> ); >> $mdb2 =& MDB2::connect($arrDsn); >> >> $seqno = 0; >> >> >> //for normal prepare >> $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; >> >> $time_start = getmicrotime(); >> $sth1 = $mdb2->prepare($sql1, MDB2_PREPARE_RESULT); >> >> $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = >> ?'; >> $arrType = array('text','integer'); >> $sth2 = $mdb2->prepare($sql2, $arrType, MDB2_PREPARE_MANIP); >> >> >> while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ >> >> if($seqno == 0){ >> $x= count($inrec); >> $arrFields = array(); >> for ($y = 0; $y < $x; $y++) { >> $arrFields[$inrec[$y]] = $y; //creates associative array that >> associates fields with the index in $inrec >> } >> >> echo "Array of Field Names From Header Record in Input data is >> \n"; >> print_r($arrFields); >> $seqno++; >> continue; } >> >> >> $key = 0+$inrec[$arrFields['Unique #']]; >> //for normal prepare >> $values = array($key); >> >> $time_start1 = getmicrotime(); >> $affectedRows =& $sth1->execute($values); >> $arrCnt['select'] += getmicrotime() - $time_start1; >> >> $time_elapsed = getmicrotime() - $time_start; >> >> if (PEAR::isError($res)) { >> die($res->getMessage()); >> } >> >> $values = array(); >> $values = array('Kevin',$key); >> >> $time_start1 = getmicrotime(); >> $affectedRows =& $sth2->execute($values); >> $arrCnt['update'] += getmicrotime() - $time_start1; >> $time_elapsed = getmicrotime() - $time_start; >> >> if (PEAR::isError($res)) { >> die($res->getMessage()); >> } >> >> if($seqno > 20000) break; >> $seqno++; >> } >> >> echo "total: ". $time_elapsed."\n"; >> echo "execution times:\n"; >> var_dump($arrCnt); >> $rate = $time_elapsed / $seqno; >> echo "rate: ".$rate."\n"; >> >> // *************** >> // Calculate the time including fractions of a second >> // *************** >> function getmicrotime() { >> $mtime = microtime(); >> $mtime = explode(' ', $mtime); >> return($mtime[1] + $mtime[0]); >> } >> >> fclose($fpiDataAddr) or die("can not close data file"); >> >> $mdb2->disconnect(); >> >> ?> >> >> >> ------------------------------------------------------------------------------------------------------------ >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> ------------------------------------------------------------------------------------------------------------ >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> ------------------------------------------------------------------------------------------------------------ >> >> >> > $fpiDataAddr = fopen('outputAddr.txt','r') or die("can not open New In >> File "); >> ini_set('memory_limit', -1); >> >> //Connect to the Database >> $dsn = 'mysql:host=localhost;dbname=demo'; >> >> $connHandle = new PDO ($dsn,'u1',''); >> >> $seqno = 0; >> $time_start = getmicrotime(); >> >> //for normal prepare >> $sql1 = 'SELECT * FROM demo.kb_addr WHERE UNIQUE_NUM = ?'; >> >> $sth1 = $connHandle->prepare($sql1); >> >> $sql2 = 'UPDATE demo.kb_addr SET AM_CITY = ? WHERE UNIQUE_NUM = >> ?'; >> $sth2 = $connHandle->prepare($sql2); >> >> while($inrec = fgetcsv($fpiDataAddr,0,',','"')){ >> >> if($seqno == 0){ >> $x= count($inrec); >> $arrFields = array(); >> for ($y = 0; $y < $x; $y++) { >> $arrFields[$inrec[$y]] = $y; //creates associative array that >> associates fields with the index in $inrec >> } >> >> $seqno++; >> continue; } >> >> >> $key = 0+$inrec[$arrFields['Unique #']]; >> //for normal prepare >> $values = array($key); >> >> $time_start1 = getmicrotime(); >> $affectedRows =& $sth1->execute($values); >> $arrCnt['select'] += getmicrotime() - $time_start1; >> >> $time_elapsed = getmicrotime() - $time_start; >> >> if (PEAR::isError($res)) { >> die($res->getMessage()); >> } >> >> $values = array(); >> $values = array('Kevin',$key); >> >> $time_start1 = getmicrotime(); >> $affectedRows =& $sth2->execute($values); >> $arrCnt['update'] += getmicrotime() - $time_start1; >> $time_elapsed = getmicrotime() - $time_start; >> >> if (PEAR::isError($res)) { >> die($res->getMessage()); >> } >> >> >> >> if($seqno > 20000) break; >> $seqno++; >> } >> >> echo "total: ". $time_elapsed."\n"; >> echo "execution times:\n"; >> var_dump($arrCnt); >> $rate = $time_elapsed / $seqno; >> echo "rate: ".$rate."\n"; >> >> // *************** >> // Calculate the time including fractions of a second >> // *************** >> function getmicrotime() { >> $mtime = microtime(); >> $mtime = explode(' ', $mtime); >> return($mtime[1] + $mtime[0]); >> } >> >> fclose($fpiDataAddr) or die("can not close data file"); >> >> //disconnect >> $connHandle = null; >> >> ?> >> >> >> >> >> >> ------------------------------ >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing Listhttp://lists.nyphp.org/mailman/listinfo/talk >> http://www.nyphp.org/show_participation.php >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > > > -- > Patrick May > +1 (347) 232-5208 > > -- Patrick May +1 (347) 232-5208 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Fri Jun 26 01:19:34 2009 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 26 Jun 2009 01:19:34 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: References: <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> Message-ID: <010501c9f61d$b1340270$139c0750$@com> > Hi, I work with Kevin. Our application needs to run on both mySQL and Oracle > so we are looking for portability. We currently are using PEAR DB and we are > looking into moving to MDB2 or PDO so we thought it would be a good idea to > test performance before we make a decision. Amazing what you find when you > dig ... If you actually do expect to need agile portability between databases, the application level programming interface is secondary. Really think about your schema (column types, return types, constraints, etc) and queries (join behavior, optimizations, transactions, limitations, etc). Most performance impact will come with the right indexes/queries/etc. and retrieval/storage strategies - not a couple of function calls here or there. Plus, it's generally much easier to scale up web servers than databases, so that'll be the first pressure point to worry about. For a "database abstraction" layer, write a simple class and interface to wrap the database's native drivers. In 2 hours you can write a lightweight class around mysqli and OCI that fits your application perfectly, gives a consistent interface, actually increases application flexibility and overall portability, and gives your code a solid code base to be built on top of. Plus it'll probably be faster. There's not really a lot of sense in my opinion to put another layer of code between what your application wants to do, and what the database actually can do. H From krozinov at gmail.com Fri Jun 26 01:33:07 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Fri, 26 Jun 2009 01:33:07 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> Message-ID: <865a7acf0906252233vcf00febn642005e1f1f5dd19@mail.gmail.com> On Thu, Jun 25, 2009 at 6:04 PM, John Campbell wrote: > On Thu, Jun 25, 2009 at 5:44 PM, Eddie Drapkin wrote: >> Wait, are you advocating //against// prepared statements? > > Not at all, but when using mysql, you should emulate them. ?I am > actually all for "prepared" style queries, if I ever see > "mysqli_real_escape_string" in someone's code, I immediately write the > person off as clueless. > What's so clueless about using mysql_real_escape_string()? I would be interested to find out. From lists at zaunere.com Fri Jun 26 02:13:07 2009 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 26 Jun 2009 02:13:07 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <865a7acf0906252233vcf00febn642005e1f1f5dd19@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> <865a7acf0906252233vcf00febn642005e1f1f5dd19@mail.gmail.com> Message-ID: <000001c9f625$2c6bb990$85432cb0$@com> > >> Wait, are you advocating //against// prepared statements? > > > > Not at all, but when using mysql, you should emulate them. ?I am > > actually all for "prepared" style queries, if I ever see > > "mysqli_real_escape_string" in someone's code, I immediately write the > > person off as clueless. > > What's so clueless about using mysql_real_escape_string()? I would be > interested to find out. Nothing in my opinion. Prepared statements can be a benefit in various situations, with those benefits being largely dictated by the database in use. With MySQL, prepared statements often are an actual drag, rather than benefit. Consider: http://dev.mysql.com/doc/refman/5.1/en/c-api-prepared-statements.html A key statement being: "Prepared execution is an efficient way to execute a statement more than once." Most statements aren't executed more than once in a typical web application/request/response cycle. Cases where I would use prepared statements: -- batch processes where the same queries are executed numerous times with varying data -- dealing with large data storage (blobs, etc.) H From oorza2k5 at gmail.com Fri Jun 26 02:31:20 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Fri, 26 Jun 2009 02:31:20 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <000001c9f625$2c6bb990$85432cb0$@com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> <865a7acf0906252233vcf00febn642005e1f1f5dd19@mail.gmail.com> <000001c9f625$2c6bb990$85432cb0$@com> Message-ID: <68de37340906252331u64e513e7p48217a5bbb9a4e5b@mail.gmail.com> On Fri, Jun 26, 2009 at 2:13 AM, Hans Zaunere wrote: >> >> Wait, are you advocating //against// prepared statements? >> > >> > Not at all, but when using mysql, you should emulate them. ?I am >> > actually all for "prepared" style queries, if I ever see >> > "mysqli_real_escape_string" in someone's code, I immediately write the >> > person off as clueless. >> >> What's so clueless about using mysql_real_escape_string()? ?I would be >> interested to find out. > > Nothing in my opinion. ?Prepared statements can be a benefit in various > situations, with those benefits being largely dictated by the database in > use. ?With MySQL, prepared statements often are an actual drag, rather than > benefit. > > Consider: > > http://dev.mysql.com/doc/refman/5.1/en/c-api-prepared-statements.html > > A key statement being: > > "Prepared execution is an efficient way to execute a statement more than > once." > > Most statements aren't executed more than once in a typical web > application/request/response cycle. > > Cases where I would use prepared statements: > > -- batch processes where the same queries are executed numerous times with > varying data > > -- dealing with large data storage (blobs, etc.) > > H > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > If, and this is an enormous if, you properly build your application around persistent connections, you ought to be able to take advantage of the erm, advantages of preparing your statements. AFAIK, the cache for prepared statements (which I'm not entirely sure MySQL even bothers to build and use, I've heard that it doesn't and after several hours of searching have given up looking for a conclusive answer) exists on a per connection basis, so the persistency of your connection ought to preserve that gain. As a general rule, I use parameterized queries with named parameters (a huge advantage PDO has over MySQLi) in all my queries, because I can afford the extra wait if the query only runs once on that connection and it's far too easy to rely on mysqli_real_escape_string and forget to use it once and have everything come crashing down around you. As far as portability is concerned, one thing I've had some level of success with is storing my queries in XML and fetching them to be prepared, then binding and executing, which makes it a whole hell of a lot easier to write queries for two different databases (in my case, PostgreSQL and MySQL) than try to implement some sort of rewriter, generator, or some other language that gets compiled into SQL (think Doctrine). Regarding have another layer between your code and your database (driver), I would have to disagree (and Hans and I have had a back and forth off list about this very thing). Consider PDO: PDO call -> PDO -> driver -> database Now consider a userland implemented DBAL: DBAL call -> DBAL -> driver -> database They look exactly the same! The primary difference being whether the extra layer of abstraction is implemented in C or in the userland and Common Wisdom has always (as far as I know, once again) suggested that it's very rare that userland code will outperform something with the same functionality written in C. I think the OP's benchmarks agree, but once again, do a few milliseconds really matter that much when the actual query is going to steal most of the time? Probably not, unless you're choking on CPU time, rather than I/O queue, which is very rarely the case. And as far as the native driver thing goes, the difference is how the driver is implemented, but in the end it's the same driver being used. The main argument against PDO that I've heard is that some of the quirks and non-standard behaviors that the various RDBMS's offer isn't handled, but in writing portable apps, consider whether or not using database-specific behavior is really a good idea. I personally don't think it is. --Eddie tl;dr: I'm a PDO fanboy From rolan at omnistep.com Fri Jun 26 04:06:24 2009 From: rolan at omnistep.com (Rolan Yang) Date: Fri, 26 Jun 2009 04:06:24 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <010501c9f61d$b1340270$139c0750$@com> References: <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <010501c9f61d$b1340270$139c0750$@com> Message-ID: <4A448180.4000507@omnistep.com> Hans Zaunere wrote: >> Hi, I work with Kevin. Our application needs to run on both mySQL and >> > Oracle > >> so we are looking for portability. We currently are using PEAR DB and we >> > are > >> looking into moving to MDB2 or PDO so we thought it would be a good idea >> > to > > If you actually do expect to need agile portability between databases, the > application level programming interface is secondary. Really think about > your schema (column types, return types, constraints, etc) and queries (join > behavior, optimizations, transactions, limitations, etc). > Kevin already stated that he has a need for MySQL/Oracle portability so the following does not likely apply, but this 3 year old article is an interesting read: http://www.xaprb.com/blog/2006/08/13/four-types-of-database-abstraction-layers/ What are your thoughts on the following paragraph? "I generally dislike Type 3 software, and I think anyone who?s ever written serious applications that require real performance from a database system will probably agree, for fairly obvious reasons. For one thing, platform-independent SQL is a myth. Easy and/or painless conversion between different database systems is, too. It does not exist in the real world. And I don?t agree with those who assert it?s a common requirement, or that it would be a good thing. I think porting from one system to another is generally rare, and trying to write ?portable? systems when there?s no clear need is going to cause nothing but problems." ~Rolan From guilhermeblanco at gmail.com Fri Jun 26 10:29:00 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Fri, 26 Jun 2009 11:29:00 -0300 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <4A448180.4000507@omnistep.com> References: <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <010501c9f61d$b1340270$139c0750$@com> <4A448180.4000507@omnistep.com> Message-ID: Hi, have you already considered an ORM tool to deal with it for you? Your situation seems to reflect the exact need for it. Here is the list of some: Doctrine Propel Outlet dORM Lumine Personally I use Doctrine. It's the most complete of all. That's why in 2007 I onboarded the project! :-) Cheers, Sent from my iPhone Em 26/06/2009, ?s 05:06, Rolan Yang escreveu: > Hans Zaunere wrote: >>> Hi, I work with Kevin. Our application needs to run on both mySQL >>> and >>> >> Oracle >> >>> so we are looking for portability. We currently are using PEAR DB >>> and we >>> >> are >> >>> looking into moving to MDB2 or PDO so we thought it would be a >>> good idea >>> >> to >> If you actually do expect to need agile portability between >> databases, the >> application level programming interface is secondary. Really think >> about >> your schema (column types, return types, constraints, etc) and >> queries (join >> behavior, optimizations, transactions, limitations, etc). >> > > > Kevin already stated that he has a need for MySQL/Oracle portability > so the following does not likely apply, but this 3 year old article > is an interesting read: > > http://www.xaprb.com/blog/2006/08/13/four-types-of-database-abstraction-layers/ > > What are your thoughts on the following paragraph? > > "I generally dislike Type 3 software, and I think anyone who?s ever > written serious applications that require real performance from a da > tabase system will probably agree, for fairly obvious reasons. For o > ne thing, platform-independent SQL is a myth. Easy and/or painless c > onversion between different database systems is, too. It does not ex > ist in the real world. And I don?t agree with those who assert > it?s a common requirement, or that it would be a good thing. I think > porting from one system to another is generally rare, and trying to > write ?portable? systems when there?s no clear need is going > to cause nothing but problems." > > > ~Rolan > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From jcampbell1 at gmail.com Fri Jun 26 12:35:18 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Fri, 26 Jun 2009 12:35:18 -0400 Subject: [nycphp-talk] Trying to decide between MDB2 and PHP PDO In-Reply-To: <865a7acf0906252233vcf00febn642005e1f1f5dd19@mail.gmail.com> References: <8632023a0906251302n32706267p1ee4fead4449823f@mail.gmail.com> <8f0676b40906251438u2bfef69cx900834ef1776b9b3@mail.gmail.com> <68de37340906251444g762ae751nfd3235eb5e836f@mail.gmail.com> <8f0676b40906251504u70f4769euf800b54b9e22ace5@mail.gmail.com> <865a7acf0906252233vcf00febn642005e1f1f5dd19@mail.gmail.com> Message-ID: <8f0676b40906260935j7e9ec0a4xc0ad472213c1e9a2@mail.gmail.com> On Fri, Jun 26, 2009 at 1:33 AM, Konstantin Rozinov wrote: > On Thu, Jun 25, 2009 at 6:04 PM, John Campbell wrote: >> On Thu, Jun 25, 2009 at 5:44 PM, Eddie Drapkin wrote: >>> Wait, are you advocating //against// prepared statements? >> >> Not at all, but when using mysql, you should emulate them. ?I am >> actually all for "prepared" style queries, if I ever see >> "mysqli_real_escape_string" in someone's code, I immediately write the >> person off as clueless. >> > > What's so clueless about using mysql_real_escape_string()? ?I would be > interested to find out. String interpolation (using double quoted strings) is inherently dangerous. All it takes is forgetting to call mysql_real_escape_string, *once* and you have a nasty vulnerability. It also makes for really bloated code. To fix the problem, you just have to stop using double quoted strings. consider this: $sql = "SELECT title from posts WHERE YEAR(posted_at)=$year" Looking at the above code, you have no way to know if that is safe or not. You cannot reason about it unless you trace the "$year" back to its source. Are you sure it can't become: $sql = "SELECT title from posts WHERE YEAR(posted_at)=2008 UNION SELECT id as title from sessions"; Now an example without string interpolation: $sql = sqlf('SELECT title from posts WHERE YEAR(posted_at)=%d',$year); We know the above code is safe regardless of the value of $year. The internals of this 'sqlf' function may call "mysql_real_escape_string", or it may use prepared queries, but the point is that we can reason that this style of coding will never let us down. If you want a good "sqlf" type function, see wordpress,drupal, or pretty much any open source project that uses a database. They all write their queries this way. If I am looking at someone else's code and it is loaded with "mysql_real_escape_string", I must just blindly trust that they haven't made one mistake anywhere in the code. To me the issue prepared, vs. non prepared. It is that escaping strings + string interpolation is inherently prone to mistakes. Regards, John Campbell From eric.gewirtz at solutiononecdi.com Mon Jun 29 12:16:01 2009 From: eric.gewirtz at solutiononecdi.com (Eric Gewirtz) Date: Mon, 29 Jun 2009 12:16:01 -0400 Subject: [nycphp-talk] oci8 bind error Message-ID: I'm getting the following error using oci_bind_by_name(). Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number in /appl/wideacc/CustMast/in/OCIpreptest.php on line 23 As you can see by the commented out bind lines, I have tried many different parms in the bind and I tried the insert with the field names and without I was getting the error on a "real" table so to isolate the issue I created a test table with one field in it (the field is a varchar(25) and called TESTNAME) We are running php 5.2.2 with oci8 1.2.3 (rev 1.269.2.16.2.32), against Oracle 10g rel 10.2.0.2.0 on SunOS ver 5.10 What makes this even stranger, if I do not "die" on the failure of the bind the oci_execute() returns true but no row is inserted into the table. I can get this to work with PEAR_DB and MDB2 but we are doing some performance testing so we want to see how using oci direct without any DB layers performs. Below is the test code I'm running; //Connect to the Database $dbUser = 'c1'; $dbPSWD = p1'; $db = 'db1'; $con = oci_connect($dbUser, $dbPSWD, $db); if (!$con) die ('Connect to DB failed'); //$insSQL = 'INSERT INTO KB_TEST (TESTNAME) VALUES (:TESTNAME)'; $insSQL = "INSERT INTO KB_TEST VALUES (:TESTNAME)"; $insSQL = strtoupper($insSQL); // upper case since ORACLE prefers upper and we know we do not have a case issue echo "SQL is $insSQL \n"; $stmt = oci_parse($con, $insSql); if (!$stmt) die ('Parse for insert failed'); //oci_bind_by_name ($stmt, ":TESTNAME", "ERIC", 25, SQLT_CHAR); //oci_bind_by_name ($stmt, ":TESTNAME", "ERIC"); //oci_bind_by_name ($stmt, ":TESTNAME", "ERIC",-1); //oci_bind_by_name ($stmt, ':TESTNAME', 'ERIC'); //oci_bind_by_name ($stmt, ':TESTNAME', 'ERIC',-1); $val = 'ERIC'; $bindVar = ':TESTNAME'; if (oci_bind_by_name ($stmt, $bindVar, $val)) { echo "Bind Successful \n"; } else { oci_close($con); die ("***** Bind Failed ***** "); } if (oci_execute ($stmt)) { echo "execute was good \n"; } else { echo "excute FAILED \n"; } oci_close($con); SolutionOne Eric Gewirtz 162 Turk Hill Road Brewster NY, 10509 Phone: 845-729-7800 FAX: 845-279-5502 -------------- next part -------------- An HTML attachment was scrubbed... URL: From afischer at smith.edu Tue Jun 30 13:02:31 2009 From: afischer at smith.edu (Aaron Fischer) Date: Tue, 30 Jun 2009 13:02:31 -0400 Subject: [nycphp-talk] Zip code radius In-Reply-To: <4A1739AE.60107@covenantedesign.com> References: <8f0676b40905221136w27dd8b64g90c7a069d5a2bfd8@mail.gmail.com> <927D5B53-B962-4AD6-B3E6-8A7EEAFB0415@smith.edu> <4A1739AE.60107@covenantedesign.com> Message-ID: Wanted to post my results. I have successfully created a zip code radius function on my site, similar to a store locator. Here's a brief recap: 1) Geocoded around 31,000 addresses sitting in my database, using Google Maps API (http://code.google.com/support/bin/answer.py?answer=80200&topic=11364 ). Modified the goodle sample code to fit my needs. One important thing to note, I was getting lots of bad responses from the API. I was able to fix this by adding "&oe=utf8" to the end of the request url. 2) Downloaded and modified this free zip code radius class (http://www.micahcarrick.com/04-19-2005/php-zip-code-range-and-distance-calculation.html ). 3) Downloaded the 1990 census bureau list of zips and geo coordinates (http://www.census.gov/tiger/tms/gazetteer/zips.txt) to use as a start point for the range lookup. More info on the census lists here (http://www.census.gov/geo/www/gazetteer/gazette.html ). 4) My code currently produces a text list of locations. I would like to add the visual google maps display with place markers. It's not an essential feature and I'll add as time allows. Will post results on that later if it happens. Thanks for everyone's helpful suggestions! Much appreciated. -Aaron From afischer at smith.edu Tue Jun 30 13:09:38 2009 From: afischer at smith.edu (Aaron Fischer) Date: Tue, 30 Jun 2009 13:09:38 -0400 Subject: [nycphp-talk] Adding spell check to a form field Message-ID: <5D01B4A5-3FCC-4694-A9B0-01E517E6A817@smith.edu> I would like to add spell check to a