From krozinov at gmail.com Sat Aug 1 03:35:06 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Sat, 1 Aug 2009 03:35:06 -0400 Subject: [nycphp-talk] session validation between http requests Message-ID: <865a7acf0908010035p285316c5of00e438a459f13ba@mail.gmail.com> Hey guys, Anyone doing session validation between HTTP requests? I know that the HTTP headers can all be changed and spoofed, but for legitimate users, I expect the HTTP headers I'm using below to NOT change between requests, during the same session. I've been looking into this lately, but ran across sites (like http://shiflett.org/articles/the-truth-about-sessions) that say that HTTP_ACCEPT_CHARSET can legitimately change between requests during a session. I've never run into this in testing, so I was wondering if somebody could confirm that statement? What about the other HTTP headers I'm using below. Can those legitimately and realistically change as well during a session? Any ideas, comments, or suggestions would be greatly welcomed! Thanks, Konstantin $client_id = ''; if (isset($_SERVER['HTTP_ACCEPT_CHARSET']) === true) { $client_id .= $_SERVER['HTTP_ACCEPT_CHARSET']; } if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) === true) { $client_id .= $_SERVER['HTTP_ACCEPT_ENCODING']; } if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) === true) { $client_id .= $_SERVER['HTTP_ACCEPT_LANGUAGE']; } if (isset($_SERVER['HTTP_USER_AGENT']) === true) { $client_id .= $_SERVER['HTTP_USER_AGENT']; } if ($_SESSION['client_id_hash'] !== md5($client_id)) { header('Location: /logout'); exit(); } From kenneth at ylayali.net Sat Aug 1 09:34:09 2009 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Sat, 1 Aug 2009 09:34:09 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <4A738EB0.6020201@covenantedesign.com> References: <20090730194550985.FZQQ28534@hrndva-omta02.mail.rr.com> <20090731113256.GB31515@ylayali.net> <4A738EB0.6020201@covenantedesign.com> Message-ID: <20090801133409.GA6361@ylayali.net> On 09-07-31 20:39 -0400, CED wrote: > Adjusting the defaults to sudoers is a big no no. That's ridiculous, it's a system config file meant to be configured. "Be careful", yes, but "Don't touch it" is a bit extreme. > Whatever it is you are doing, the need to become root is far different > than Ken's example of becoming Ken. Noone said anything about root. sudo does not imply root. Using sudo and understanding how to configure it is a security plus, not a minus. From ajai at bitblit.net Sat Aug 1 09:44:29 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sat, 1 Aug 2009 09:44:29 -0400 (EDT) Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090801133409.GA6361@ylayali.net> Message-ID: On Sat, 1 Aug 2009, Kenneth Dombrowski wrote: > That's ridiculous, it's a system config file meant to be configured. > "Be careful", yes, but "Don't touch it" is a bit extreme. I think history has shown that most programmers are not system administrators and often dont think through all the implications of what they're doing. So, in that context, I dont think its extreme to say not to mess with it. If you can peform the task without it, which is true in this case, then do so. -- Aj. (programmer + sys. admin :-) From kenneth at ylayali.net Sat Aug 1 09:54:16 2009 From: kenneth at ylayali.net (Kenneth Dombrowski) Date: Sat, 1 Aug 2009 09:54:16 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: References: <20090801133409.GA6361@ylayali.net> Message-ID: <20090801135416.GB6361@ylayali.net> On 09-08-01 09:44 -0400, Ajai Khattri wrote: > I think history has shown that most programmers are not system > administrators and often dont think through all the implications of what > they're doing. So, in that context, I dont think its extreme to say not to > mess with it. If you can peform the task without it, which is true in this > case, then do so. Ok, point taken. Thanks Aj From webmaster at vbplusme.com Sat Aug 1 12:17:58 2009 From: webmaster at vbplusme.com (webmaster at vbplusme.com) Date: Sun, 2 Aug 2009 00:17:58 +0800 Subject: [nycphp-talk] preg_replace to extract a domain name? Message-ID: <574631668.20090802001758@vbplusme.com> Hello NYPHP, I am using preg_replace to try to extract the domain name of one of my sites so that I can use it as a variable. It has a standard http format, i.e. http://www.mydomain.com and I am trying to get only "mydomain" from it. I have something that works but it does multiple tests before it generates the variable I need. I thinking that the multiple lines ought to be combined into a single statement that does the job on one fell swoop. Am I right in assuming this can be done in one line of code? TIA for any pointers. -- Best regards, webmaster mailto:webmaster at vbplusme.com From justin at justinhileman.info Sat Aug 1 12:36:59 2009 From: justin at justinhileman.info (Justin Hileman) Date: Sat, 01 Aug 2009 12:36:59 -0400 Subject: [nycphp-talk] preg_replace to extract a domain name? In-Reply-To: <574631668.20090802001758@vbplusme.com> References: <574631668.20090802001758@vbplusme.com> Message-ID: <4A746F2B.8070506@justinhileman.info> webmaster at vbplusme.com wrote: > Hello NYPHP, > > I am using preg_replace to try to extract the domain name of one of my > sites so that I can use it as a variable. It has a standard http > format, i.e. http://www.mydomain.com and I am trying to get only > "mydomain" from it. > > I have something that works but it does multiple tests before it > generates the variable I need. I thinking that the multiple lines > ought to be combined into a single statement that does the job on one > fell swoop. Am I right in assuming this can be done in one line of > code? > > TIA for any pointers. > Use parse_url() http://us3.php.net/parse_url Something like this: $domain = parse_url($my_url, PHP_URL_HOST); Or, if you want some of the other pieces later: $chunks = parse_url($my_url); $domain = $chunks['host']; // then you can use 'path', 'query', etc. as well. -- justin http://justinhileman.com From jcampbell1 at gmail.com Sat Aug 1 22:02:55 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Sat, 1 Aug 2009 22:02:55 -0400 Subject: [nycphp-talk] session validation between http requests In-Reply-To: <865a7acf0908010035p285316c5of00e438a459f13ba@mail.gmail.com> References: <865a7acf0908010035p285316c5of00e438a459f13ba@mail.gmail.com> Message-ID: <8f0676b40908011902q3dc8e2f4i7bc294f1d5ac30c6@mail.gmail.com> On Sat, Aug 1, 2009 at 3:35 AM, Konstantin Rozinov wrote: > Any ideas, comments, or suggestions would be greatly welcomed! For improved security, you should not do: > ? ? ? ?header('Location: /logout'); but rather invalidate the session right there. Your code relies on the attacker actually following redirects to unset the session. People who hijack sessions don't follow redirects. I did a test to see if this would actually be valuable, and from my access log file the most common user agent only had 3% of the traffic, so I think there is some value to this approach. I think 'httponly' cookies is probably a better XSS attack mitigation strategy in the long run (though there is no reason you can't do both). In php 5.2+ the option is: ini_set("session.cookie_httponly", 1); It is supported by FF 3+, IE7+, and Safari 4+ Regards, John Campbell From leam at reuel.net Sun Aug 2 17:17:08 2009 From: leam at reuel.net (Leam Hall) Date: Sun, 02 Aug 2009 17:17:08 -0400 Subject: [nycphp-talk] SSH2_CONNECT In-Reply-To: <20090801135416.GB6361@ylayali.net> References: <20090801133409.GA6361@ylayali.net> <20090801135416.GB6361@ylayali.net> Message-ID: <4A760254.3030603@reuel.net> Kenneth Dombrowski wrote: > On 09-08-01 09:44 -0400, Ajai Khattri wrote: >>If you can peform the task without it, which is true in this >> case, then do so. > > Ok, point taken. > > Thanks Aj No argument there. What you can do, and what you should do, are often not the same. :) Leam From krozinov at gmail.com Thu Aug 6 01:16:00 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Thu, 6 Aug 2009 01:16:00 -0400 Subject: [nycphp-talk] session validation between http requests In-Reply-To: <865a7acf0908010035p285316c5of00e438a459f13ba@mail.gmail.com> References: <865a7acf0908010035p285316c5of00e438a459f13ba@mail.gmail.com> Message-ID: <865a7acf0908052216m5a537aecna6201dc654217cb9@mail.gmail.com> ping....sorry just wanted to see one last time if anyone had any suggestions/ideas? On Sat, Aug 1, 2009 at 3:35 AM, Konstantin Rozinov wrote: > Hey guys, > > Anyone doing session validation between HTTP requests? ?I know that > the HTTP headers can all be changed and spoofed, but for legitimate > users, I expect the HTTP headers I'm using below to NOT change between > requests, during the same session. > > I've been looking into this lately, but ran across sites (like > http://shiflett.org/articles/the-truth-about-sessions) that say that > HTTP_ACCEPT_CHARSET can legitimately change between requests during a > session. ?I've never run into this in testing, so I was wondering if > somebody could confirm that statement? > > What about the other HTTP headers I'm using below. ?Can those > legitimately and realistically change as well during a session? > > Any ideas, comments, or suggestions would be greatly welcomed! > > Thanks, > Konstantin > > > $client_id = ''; > > if (isset($_SERVER['HTTP_ACCEPT_CHARSET']) === true) > { > ? ? ? ?$client_id .= $_SERVER['HTTP_ACCEPT_CHARSET']; > } > if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) === true) > { > ? ? ? ?$client_id .= $_SERVER['HTTP_ACCEPT_ENCODING']; > } > if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) === true) > { > ? ? ? ?$client_id .= $_SERVER['HTTP_ACCEPT_LANGUAGE']; > } > if (isset($_SERVER['HTTP_USER_AGENT']) === true) > { > ? ? ? ?$client_id .= $_SERVER['HTTP_USER_AGENT']; > } > > if ($_SESSION['client_id_hash'] !== md5($client_id)) > { > ? ? ? ?header('Location: /logout'); > ? ? ? ?exit(); > } > From krozinov at gmail.com Thu Aug 6 01:16:20 2009 From: krozinov at gmail.com (Konstantin Rozinov) Date: Thu, 6 Aug 2009 01:16:20 -0400 Subject: [nycphp-talk] session validation between http requests In-Reply-To: <8f0676b40908011902q3dc8e2f4i7bc294f1d5ac30c6@mail.gmail.com> References: <865a7acf0908010035p285316c5of00e438a459f13ba@mail.gmail.com> <8f0676b40908011902q3dc8e2f4i7bc294f1d5ac30c6@mail.gmail.com> Message-ID: <865a7acf0908052216v5f824940xe85e2b8e866604d6@mail.gmail.com> Thanks for both suggestions. On Sat, Aug 1, 2009 at 10:02 PM, John Campbell wrote: > On Sat, Aug 1, 2009 at 3:35 AM, Konstantin Rozinov wrote: > >> Any ideas, comments, or suggestions would be greatly welcomed! > > For improved security, you should not do: > >> ? ? ? ?header('Location: /logout'); > > but rather invalidate the session right there. ?Your code relies on > the attacker actually following redirects to unset the session. > People who hijack sessions don't follow redirects. > > I did a test to see if this would actually be valuable, and from my > access log file the most common user agent only had 3% of the traffic, > so I think there is some value to this approach. ?I think 'httponly' > cookies is probably a better XSS attack mitigation strategy in the > long run (though there is no reason you can't do both). > > In php 5.2+ the option is: > ini_set("session.cookie_httponly", 1); > > It is supported by FF 3+, IE7+, and Safari 4+ > > 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 > From ajai at bitblit.net Thu Aug 6 18:00:44 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 6 Aug 2009 18:00:44 -0400 (EDT) Subject: [nycphp-talk] Barcodes Message-ID: Im looking for an algorithm or description of how someone would go about reading the barcode from an image. Are there any libraries out there that I can use? -- Aj. From zippy1981 at gmail.com Thu Aug 6 18:14:27 2009 From: zippy1981 at gmail.com (Justin Dearing) Date: Thu, 6 Aug 2009 18:14:27 -0400 Subject: [nycphp-talk] Barcodes In-Reply-To: References: Message-ID: <5458db3c0908061514x632a8b19me53ec216c1bc46ba@mail.gmail.com> http://lmsotfy.com/index.php?q=Barcode%20Image%20File%20Reader%20Library Also take a look at: http://stackoverflow.com/questions/191192/recommend-an-open-source-net-barcode-reader-library On Thu, Aug 6, 2009 at 6:00 PM, Ajai Khattri wrote: > > Im looking for an algorithm or description of how someone would go about > reading the barcode from an image. Are there any libraries out there that > I can use? > > > -- > Aj. > > _______________________________________________ > 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 Aug 6 18:50:30 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 6 Aug 2009 18:50:30 -0400 Subject: [nycphp-talk] Barcodes In-Reply-To: References: Message-ID: <8f0676b40908061550k6713610ej367567bbcecc0fd3@mail.gmail.com> Zebra Crossing is a java based project that probably does what you want. Haven't used it personally, but I know it is behind the Shop Savvy andriod application. I am quite sure you wont find anything with php bindings. On Thu, Aug 6, 2009 at 6:00 PM, Ajai Khattri wrote: > > Im looking for an algorithm or description of how someone would go about > reading the barcode from an image. Are there any libraries out there that > I can use? > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From rolan at omnistep.com Thu Aug 6 18:53:30 2009 From: rolan at omnistep.com (Rolan Yang) Date: Thu, 06 Aug 2009 18:53:30 -0400 Subject: [nycphp-talk] Barcodes In-Reply-To: References: Message-ID: <4A7B5EEA.6050707@omnistep.com> Many barcode reading devices act as a keyboard emulator via USB or PS2 connector. I have written keyboardless touchscreen and barcode scanner kiosk apps based on apache/php. One simple trick is to create a form on the page and have a body onload javascript running that does a constant "focus" to the form field. That way input from the scanner is always entered into the form. If you don't want the field to be visible, use some css to make it the same color as the background or very tiny in size. The scanner device should read the barcode, dump it to the form field and send an "enter" key when done. ~Rolan Ajai Khattri wrote: > Im looking for an algorithm or description of how someone would go about > reading the barcode from an image. Are there any libraries out there that > I can use? > > > From ramons at gmx.net Fri Aug 7 07:06:11 2009 From: ramons at gmx.net (David Krings) Date: Fri, 07 Aug 2009 07:06:11 -0400 Subject: [nycphp-talk] Barcodes In-Reply-To: <4A7B5EEA.6050707@omnistep.com> References: <4A7B5EEA.6050707@omnistep.com> Message-ID: <4A7C0AA3.9050404@gmx.net> Rolan Yang wrote: > Many barcode reading devices act as a keyboard emulator via USB or PS2 > connector. > > Ajai Khattri wrote: >> Im looking for an algorithm or description of how someone would go >> about reading the barcode from an image. Are there any libraries out >> there that I can use? I think the question is to read it from an image, not the actual barcode using a scanner. David From sequethin at gmail.com Fri Aug 7 08:05:42 2009 From: sequethin at gmail.com (sequethin at gmail.com) Date: Fri, 7 Aug 2009 12:05:42 +0000 Subject: [nycphp-talk] Barcodes Message-ID: <24278602-1249646861-cardhu_decombobulator_blackberry.rim.net-1768949542-@bxe1089.bisx.prod.on.blackberry> So it would be something like OCR for barcodes? I would be interested in that as well. I hate to say this but... Isn't there "an app for that"? (Sorry for the top post my blackberry is being a PITA) ------Original Message------ From: David Krings Sender: talk-bounces at lists.nyphp.org To: NYPHP Talk ReplyTo: NYPHP Talk Subject: Re: [nycphp-talk] Barcodes Sent: Aug 7, 2009 7:06 AM Rolan Yang wrote: > Many barcode reading devices act as a keyboard emulator via USB or PS2 > connector. > > Ajai Khattri wrote: >> Im looking for an algorithm or description of how someone would go >> about reading the barcode from an image. Are there any libraries out >> there that I can use? I think the question is to read it from an image, not the actual barcode using a scanner. David _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php Sent via BlackBerry from T-Mobile From mangesh at ascellent.co.in Mon Aug 10 01:51:24 2009 From: mangesh at ascellent.co.in (Mangesh Sathe) Date: Mon, 10 Aug 2009 11:21:24 +0530 Subject: [nycphp-talk] talk Digest, Vol 34, Issue 5 In-Reply-To: References: Message-ID: Hi ajai, Just go through http://www.barcodephp.com/download.php dowload suitable version & test it on yr side You will get the basic idea of barcode.& use that image wherever u want On Fri, Aug 7, 2009 at 9:30 PM, wrote: > 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. Barcodes (Ajai Khattri) > 2. Re: Barcodes (Justin Dearing) > 3. Re: Barcodes (John Campbell) > 4. Re: Barcodes (Rolan Yang) > 5. Re: Barcodes (David Krings) > 6. Re: Barcodes (sequethin at gmail.com) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 6 Aug 2009 18:00:44 -0400 (EDT) > From: Ajai Khattri > To: NYPHP Talk > Subject: [nycphp-talk] Barcodes > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII > > > Im looking for an algorithm or description of how someone would go about > reading the barcode from an image. Are there any libraries out there that > I can use? > > > -- > Aj. > > > > ------------------------------ > > Message: 2 > Date: Thu, 6 Aug 2009 18:14:27 -0400 > From: Justin Dearing > To: NYPHP Talk > Subject: Re: [nycphp-talk] Barcodes > Message-ID: > <5458db3c0908061514x632a8b19me53ec216c1bc46ba at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > http://lmsotfy.com/index.php?q=Barcode%20Image%20File%20Reader%20Library > Also take a look at: > > > http://stackoverflow.com/questions/191192/recommend-an-open-source-net-barcode-reader-library > > > On Thu, Aug 6, 2009 at 6:00 PM, Ajai Khattri wrote: > > > > > Im looking for an algorithm or description of how someone would go about > > reading the barcode from an image. Are there any libraries out there that > > I can use? > > > > > > -- > > Aj. > > > > _______________________________________________ > > 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: < > http://lists.nyphp.org/pipermail/talk/attachments/20090806/f1dd5691/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Thu, 6 Aug 2009 18:50:30 -0400 > From: John Campbell > To: NYPHP Talk > Subject: Re: [nycphp-talk] Barcodes > Message-ID: > <8f0676b40908061550k6713610ej367567bbcecc0fd3 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Zebra Crossing is a java based project that probably does what you > want. Haven't used it personally, but I know it is behind the Shop > Savvy andriod application. I am quite sure you wont find anything > with php bindings. > > On Thu, Aug 6, 2009 at 6:00 PM, Ajai Khattri wrote: > > > > Im looking for an algorithm or description of how someone would go about > > reading the barcode from an image. Are there any libraries out there that > > I can use? > > > > > > -- > > Aj. > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show_participation.php > > > > > ------------------------------ > > Message: 4 > Date: Thu, 06 Aug 2009 18:53:30 -0400 > From: Rolan Yang > To: NYPHP Talk > Subject: Re: [nycphp-talk] Barcodes > Message-ID: <4A7B5EEA.6050707 at omnistep.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Many barcode reading devices act as a keyboard emulator via USB or PS2 > connector. > > I have written keyboardless touchscreen and barcode scanner kiosk apps > based on apache/php. > One simple trick is to create a form on the page and have a body onload > javascript running that does a constant "focus" to the form field. That > way input from the scanner is always entered into the form. If you > don't want the field to be visible, use some css to make it the same > color as the background or very tiny in size. The scanner device should > read the barcode, dump it to the form field and send an "enter" key when > done. > > ~Rolan > > Ajai Khattri wrote: > > Im looking for an algorithm or description of how someone would go about > > reading the barcode from an image. Are there any libraries out there that > > I can use? > > > > > > > > > ------------------------------ > > Message: 5 > Date: Fri, 07 Aug 2009 07:06:11 -0400 > From: David Krings > To: NYPHP Talk > Subject: Re: [nycphp-talk] Barcodes > Message-ID: <4A7C0AA3.9050404 at gmx.net> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Rolan Yang wrote: > > Many barcode reading devices act as a keyboard emulator via USB or PS2 > > connector. > > > > Ajai Khattri wrote: > >> Im looking for an algorithm or description of how someone would go > >> about reading the barcode from an image. Are there any libraries out > >> there that I can use? > > I think the question is to read it from an image, not the actual barcode > using > a scanner. > > David > > > ------------------------------ > > Message: 6 > Date: Fri, 7 Aug 2009 12:05:42 +0000 > From: sequethin at gmail.com > To: "NYPHP Talk" > Subject: Re: [nycphp-talk] Barcodes > Message-ID: > > <24278602-1249646861-cardhu_decombobulator_blackberry.rim.net-1768949542- at bxe1089.bisx.prod.on.blackberry > > > > Content-Type: text/plain > > So it would be something like OCR for barcodes? I would be interested in > that as well. I hate to say this but... Isn't there "an app for that"? > > (Sorry for the top post my blackberry is being a PITA) > > > ------Original Message------ > From: David Krings > Sender: talk-bounces at lists.nyphp.org > To: NYPHP Talk > ReplyTo: NYPHP Talk > Subject: Re: [nycphp-talk] Barcodes > Sent: Aug 7, 2009 7:06 AM > > Rolan Yang wrote: > > Many barcode reading devices act as a keyboard emulator via USB or PS2 > > connector. > > > > Ajai Khattri wrote: > >> Im looking for an algorithm or description of how someone would go > >> about reading the barcode from an image. Are there any libraries out > >> there that I can use? > > I think the question is to read it from an image, not the actual barcode > using > a scanner. > > David > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > Sent via BlackBerry from T-Mobile > > ------------------------------ > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > End of talk Digest, Vol 34, Issue 5 > *********************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Mon Aug 10 13:29:42 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Mon, 10 Aug 2009 13:29:42 -0400 Subject: [nycphp-talk] Broken Link Checker Message-ID: <20090810173105559.PQWO7180@hrndva-omta03.mail.rr.com> Before I get started, does anyone know of a library or good approach to checking broken links. I'm thinking I have to parse the document searching for href or src and see make sure the links return 401? I don't want to do this in php. What function would be good for validating the link? Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From gatzby3jr at gmail.com Mon Aug 10 13:33:20 2009 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Mon, 10 Aug 2009 13:33:20 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <20090810173105559.PQWO7180@hrndva-omta03.mail.rr.com> References: <20090810173105559.PQWO7180@hrndva-omta03.mail.rr.com> Message-ID: <29da5d150908101033g794d81eckf09a5dbc053ffe29@mail.gmail.com> Wouldn't you want 200? On Mon, Aug 10, 2009 at 1:29 PM, Michele Waldman wrote: > Before I get started, does anyone know of a library or good approach to > checking broken links. > > > > I?m thinking I have to parse the document searching for href or src and see > make sure the links return 401? > > > > I don?t want to do this in php. What function would be good for validating > the link? > > > > Michele > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Mon Aug 10 13:34:42 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Mon, 10 Aug 2009 13:34:42 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <29da5d150908101033g794d81eckf09a5dbc053ffe29@mail.gmail.com> Message-ID: <20090810173604642.DZEW26506@hrndva-omta01.mail.rr.com> Right. I don't want 401. Do you know which php function can be used to check that? Michel _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Brian O'Connor Sent: Monday, August 10, 2009 1:33 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Broken Link Checker Wouldn't you want 200? On Mon, Aug 10, 2009 at 1:29 PM, Michele Waldman wrote: Before I get started, does anyone know of a library or good approach to checking broken links. I'm thinking I have to parse the document searching for href or src and see make sure the links return 401? I don't want to do this in php. What function would be good for validating the link? Michele _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at zaunere.com Mon Aug 10 13:40:46 2009 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 10 Aug 2009 13:40:46 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <20090810173604642.DZEW26506@hrndva-omta01.mail.rr.com> References: <29da5d150908101033g794d81eckf09a5dbc053ffe29@mail.gmail.com> <20090810173604642.DZEW26506@hrndva-omta01.mail.rr.com> Message-ID: <0a2601ca19e1$b1458620$13d09260$@com> > Right. I don't want 401. Do you know which php function can be used > to check that? http://us.php.net/curl http://us.php.net/manual/en/book.http.php http://us.php.net/manual/en/wrappers.http.php ... depending on your version of PHP and what's available on the server. The first or last options above are probably more likely to be available. H From ajai at bitblit.net Mon Aug 10 13:52:12 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 10 Aug 2009 13:52:12 -0400 (EDT) Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <20090810173105559.PQWO7180@hrndva-omta03.mail.rr.com> Message-ID: On Mon, 10 Aug 2009, Michele Waldman wrote: > Before I get started, does anyone know of a library or good approach to > checking broken links. > > I'm thinking I have to parse the document searching for href or src and see > make sure the links return 401? > > I don't want to do this in php. What function would be good for validating > the link? http://htcheck.sourceforge.net/info.html -- Aj. From mmwaldman at nyc.rr.com Mon Aug 10 18:22:18 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Mon, 10 Aug 2009 18:22:18 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <0a2601ca19e1$b1458620$13d09260$@com> Message-ID: <20090810222341388.RRGN26506@hrndva-omta01.mail.rr.com> The curl seemed to be taking a while. I noticed file_get_contents issues warnings to standard output when the file is not found: Warning: file_get_contents(http://www.AkronGayRealEstate.com/theImages[i];): failed to open stream: HTTP request failed! HTTP/1. 1 404 Not Found A try catch block didn't seem to intercept this. How can I catch a warning in the code? 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 Hans Zaunere > Sent: Monday, August 10, 2009 1:41 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] Broken Link Checker > > > Right. I don't want 401. Do you know which php function can be used > > to check that? > > http://us.php.net/curl > > http://us.php.net/manual/en/book.http.php > > http://us.php.net/manual/en/wrappers.http.php > > ... depending on your version of PHP and what's available on the server. > The first or last options above are probably more likely to be available. > > H > > > _______________________________________________ > 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 Mon Aug 10 18:24:59 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Mon, 10 Aug 2009 18:24:59 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <0a2601ca19e1$b1458620$13d09260$@com> Message-ID: <20090810222622256.RTOE26506@hrndva-omta01.mail.rr.com> I guess I could use if file_exists. 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 Hans Zaunere > Sent: Monday, August 10, 2009 1:41 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] Broken Link Checker > > > Right. I don't want 401. Do you know which php function can be used > > to check that? > > http://us.php.net/curl > > http://us.php.net/manual/en/book.http.php > > http://us.php.net/manual/en/wrappers.http.php > > ... depending on your version of PHP and what's available on the server. > The first or last options above are probably more likely to be available. > > H > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From chehodgins at gmail.com Mon Aug 10 18:38:04 2009 From: chehodgins at gmail.com (Che Hodgins) Date: Mon, 10 Aug 2009 18:38:04 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <20090810173105559.PQWO7180@hrndva-omta03.mail.rr.com> References: <20090810173105559.PQWO7180@hrndva-omta03.mail.rr.com> Message-ID: On Mon, Aug 10, 2009 at 1:29 PM, Michele Waldman wrote: > Before I get started, does anyone know of a library or good approach to > checking broken links. > > > > I?m thinking I have to parse the document searching for href or src and see > make sure the links return 401? > > > > I don?t want to do this in php.? What function would be good for validating > the link? > > > > Michele > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > Instead of crawling the site yourself, have Google crawl it and report broken links :) http://www.google.com/webmasters/ Che From lists at zaunere.com Mon Aug 10 19:51:24 2009 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 10 Aug 2009 19:51:24 -0400 Subject: [nycphp-talk] PHP Conference - VOTE NOW Message-ID: <0bd801ca1a15$785b86a0$691293e0$@com> Hello, As some may have heard, CodeWorks is coming to NYC in October - we'll post more details as their available but suffice it to say, that each local stop on the CodeWorks road show allows one local speaker. Over on the Org list, I've asked folks to submit abstracts, and now we have a chance to vote on the topics. The abstract that receives the most votes will be the primary speaker, and the second, well, secondary/backup. Please email me directly off list with your votes as to not clutter this list, then I'll announce the selected speakers. Please vote only for two talks. Here they are: An Introduction to Zend AMF Zend AMF gives developers the ability to quickly and efficiently communicate between Flex and PHP. In this talk we'll cover the basics of setting up an application that uses Zend AMF, look at some common errors that you may encounter and explore the ways we can display and manipulate our data once it's in Flex. Coding Secure with PHP and Enterprise LAMP Security Anyone involved in web application development over the last five years should be aware of the security ecosystem surrounding PHP. Often overhyped, sometimes dramatic, and always interesting, the topics of PHP and security are usually linked at the hip, and a favorite comedy topic for those involved with other languages. While PHP has made some security mistakes in the past, the focus of criticism is often misguided. The applicable codebase for the security notices - whether it be the PHP core, an extension, or an application - is forgotten and PHP as a whole gets one more strike. PHP also provides great power and flexibility. But with it, comes great responsibility. As with any application living on the internet, it's the entire support staff's responsibility architect, developer, and administrator - to ensure an application meets organization security requirements. In this talk, we'll provide tips, tricks, and fundamental best practices from the trenches for ensuring your code and LAMP deployment isn't caught off guard. He'll then review the PHP security ecosystem and available resources, debunk myths, and reveal some surprising facts that could leave you thinking PHP is one of the most secure languages available today. Extreme Scale with Thin Server Architecture As website interactivity demands put a bigger strain on your beautiful code, faster internet connections and more website visitors don't make it any easier. There is a way to dramatically drop the overhead of rendering a page, by asking the browser to do all the work. Learn how to scale your applications to absurd extremes with this simple, ingenious concept. I Smoked Too Much PHP Let's face it, we all love our PHP. And after all these countless hours spent mastering our craft, and then more countless hours bickering with our cohorts about who is better, we learned the shocking truth: There is more out there. We occasionally hear about other languages and their offerings, and some people even like them. Gasp! What is all the fuss about? A sometimes funny and occasionally accurate telling of what is going on out there in the non-PHP world of mundanes. MySQL and PHP - State of the Union Latest look on that famous couple, MySQL and PHP. He'll cover the latest in connectors, best practices and techniques, how to optimize performance between the two, scaling, and how all of this fits into the latest buzzword, the cloud. The State of the PHP CMS Many believe the rich variety of PHP-based Content Management Systems (CMS) greatly accelerated the adoption of PHP both in the consumer and corporate sectors. This session identifies the key players and outlines a brief history of each, as well as demonstrate their strengths and weaknesses. Best of all is an open discussion of not only what is coming in the future, but what everyone really wants. Thanks all, H From ps at blu-studio.com Mon Aug 10 20:19:13 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Mon, 10 Aug 2009 20:19:13 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <20090810173105559.PQWO7180@hrndva-omta03.mail.rr.com> References: <20090810173105559.PQWO7180@hrndva-omta03.mail.rr.com> Message-ID: <003601ca1a19$5c666740$153335c0$@com> Enter the page URL(s) of links you want to check here: http://validator.w3.org/checklink OR http://seopro.com.au/free-seo-tools/link-checker I believe there are more free services like this too. Warmest regards, ? Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Michele Waldman Sent: Monday, August 10, 2009 1:30 PM To: 'NYPHP Talk' Subject: [nycphp-talk] Broken Link Checker Before I get started, does anyone know of a library or good approach to checking broken links. I?m thinking I have to parse the document searching for href or src and see make sure the links return 401? I don?t want to do this in php.? What function would be good for validating the link? Michele From mmwaldman at nyc.rr.com Mon Aug 10 20:56:07 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Mon, 10 Aug 2009 20:56:07 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <003601ca1a19$5c666740$153335c0$@com> Message-ID: <20090811005730613.CINA15589@hrndva-omta02.mail.rr.com> I'm running a cron job to check 800 sites. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Peter Sawczynec > Sent: Monday, August 10, 2009 8:19 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] Broken Link Checker > > Enter the page URL(s) of links you want to check here: > > http://validator.w3.org/checklink > > OR > > http://seopro.com.au/free-seo-tools/link-checker > > I believe there are more free services like this too. > > Warmest regards, > > Peter Sawczynec > Technology Dir. > bl?studio > 941.893.0396 > ps at blu-studio.com > www.blu-studio.com > > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Michele Waldman > Sent: Monday, August 10, 2009 1:30 PM > To: 'NYPHP Talk' > Subject: [nycphp-talk] Broken Link Checker > > Before I get started, does anyone know of a library or good approach to > checking broken links. > > I?m thinking I have to parse the document searching for href or src and > see make sure the links return 401? > > I don?t want to do this in php.? What function would be good for > validating the link? > > Michele > > > _______________________________________________ > 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 Mon Aug 10 22:25:01 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Mon, 10 Aug 2009 22:25:01 -0400 Subject: [nycphp-talk] Broken Link Checker In-Reply-To: <20090811005730613.CINA15589@hrndva-omta02.mail.rr.com> References: <003601ca1a19$5c666740$153335c0$@com> <20090811005730613.CINA15589@hrndva-omta02.mail.rr.com> Message-ID: <003701ca1a2a$f14c2b90$d3e482b0$@com> Then you've got all you'll need. 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: Monday, August 10, 2009 8:56 PM To: 'NYPHP Talk' Subject: Re: [nycphp-talk] Broken Link Checker I'm running a cron job to check 800 sites. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Peter Sawczynec > Sent: Monday, August 10, 2009 8:19 PM > To: 'NYPHP Talk' > Subject: Re: [nycphp-talk] Broken Link Checker > > Enter the page URL(s) of links you want to check here: > > http://validator.w3.org/checklink > > OR > > http://seopro.com.au/free-seo-tools/link-checker > > I believe there are more free services like this too. > > Warmest regards, > > Peter Sawczynec > Technology Dir. > bl?studio > 941.893.0396 > ps at blu-studio.com > www.blu-studio.com > > > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Michele Waldman > Sent: Monday, August 10, 2009 1:30 PM > To: 'NYPHP Talk' > Subject: [nycphp-talk] Broken Link Checker > > Before I get started, does anyone know of a library or good approach to > checking broken links. > > I?m thinking I have to parse the document searching for href or src and > see make sure the links return 401? > > I don?t want to do this in php.? What function would be good for > validating the link? > > Michele > > > _______________________________________________ > 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 mangesh at ascellent.co.in Tue Aug 11 01:04:29 2009 From: mangesh at ascellent.co.in (Mangesh Sathe) Date: Tue, 11 Aug 2009 10:34:29 +0530 Subject: [nycphp-talk] I want to take all database backup Message-ID: Hello everyone, I am developing one ERP, i want to take backup of all database from my ERP website (by clicking on hyperlink / button). i want to know the steps for doing this & which mysql queries are essential. any help would be appreciated ... -- Thanks & Regards, Mangesh Sathe -------------- next part -------------- An HTML attachment was scrubbed... URL: From arzala at gmail.com Tue Aug 11 04:06:34 2009 From: arzala at gmail.com (Anirudhsinh Zala) Date: Tue, 11 Aug 2009 13:36:34 +0530 Subject: [nycphp-talk] I want to take all database backup In-Reply-To: References: Message-ID: <200908111336.35062.arzala@gmail.com> On Tuesday 11 Aug 2009 10:34:29 am Mangesh Sathe wrote: > Hello everyone, > > I am developing one ERP, > i want to take backup of all database from my ERP website (by clicking on > hyperlink / button). > > i want to know the steps for doing this & which mysql queries are > essential. Sorry for quick answer, but you need to use utilities (commands) like "mysqldump" or "mysqlhotcopy" to do. Just SQL queries wont help for lot of databases. However you may invoke above commands from web by taking proper precautions. Otherwise just run them from console. For more information study MySQL manual. There is enough documentation about this task. Thanks Anirudh Zala > > any help would be appreciated ... From webmaster at vbplusme.com Tue Aug 11 09:59:17 2009 From: webmaster at vbplusme.com (webmaster at vbplusme.com) Date: Tue, 11 Aug 2009 21:59:17 +0800 Subject: [nycphp-talk] PHP testing for a password protected folder/file Message-ID: <371125141.20090811215917@vbplusme.com> Hello NYPHP, I have an errorpage script that checks for $_SERVER['REDIRECT_STATUS'] and delivers a user friendly message depending on which error condition it finds, works great most of the time. The problem is when is encountered a password protected folder, it delivers the 401 or 403 error message and completely ignores/bypasses the popup username/password window that usually occurs in .htaccess password protected folders. What test / condition do I need to use to check for if a folder is password protected in combination with the REDIRECT_STATUS to allow the popup window instead of automatically generating the 401 / 403 error messages? TIA for any help. This was a total surprise to me after I deployed the script so I have a bit of a bind to fix it ASAP. -- Best regards, webmaster mailto:webmaster at vbplusme.com From mangesh at ascellent.co.in Wed Aug 12 03:47:51 2009 From: mangesh at ascellent.co.in (Mangesh Sathe) Date: Wed, 12 Aug 2009 13:17:51 +0530 Subject: [nycphp-talk] Looking For Search Engine Optimization SEO Method Message-ID: hello everyone, this is Mangesh Sathe I am working on SEO Search engine Optimization. are there any tools available for SEO or websites for SEO? what are the basic steps required for SEO or shud i make any change in source code. basically i want my website in first /second page on google, microsoft search engine,yahoo search engine. Plz Reply -- Thanks & Regards, Mangesh Sathe -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Wed Aug 12 05:57:49 2009 From: leam at reuel.net (Leam Hall) Date: Wed, 12 Aug 2009 05:57:49 -0400 Subject: [nycphp-talk] Java provides??? Message-ID: <4A82921D.7000908@reuel.net> Gang, I'll confess that I'm happy to support Java as it provides lots of reasons to upgrade hardware and buy newer/faster machines. However, from a systems engineering standpoint, I'm baffled by the recurring inefficiency of hundreds of corporate programmers... What does Java provide that PHP can't do faster and with lighter resource usage? Leam From mattwilliamsnyc at gmail.com Wed Aug 12 07:23:27 2009 From: mattwilliamsnyc at gmail.com (Matt Williams) Date: Wed, 12 Aug 2009 07:23:27 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A82921D.7000908@reuel.net> References: <4A82921D.7000908@reuel.net> Message-ID: <51BB40AB-9A44-4953-B00D-CCD0E96B8DC4@gmail.com> On Aug 12, 2009, at 5:57, Leam Hall wrote: > What does Java provide that PHP can't do faster and with lighter > resource usage? Concurrency and threading to name a couple... From ramons at gmx.net Wed Aug 12 07:34:31 2009 From: ramons at gmx.net (David Krings) Date: Wed, 12 Aug 2009 07:34:31 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A82921D.7000908@reuel.net> References: <4A82921D.7000908@reuel.net> Message-ID: <4A82A8C7.7000208@gmx.net> Leam Hall wrote: > Gang, I'll confess that I'm happy to support Java as it provides lots of > reasons to upgrade hardware and buy newer/faster machines. However, from > a systems engineering standpoint, I'm baffled by the recurring > inefficiency of hundreds of corporate programmers... > > What does Java provide that PHP can't do faster and with lighter > resource usage? Don't know in detail, but my guess is that PHP is thought of about to be a pure web only scripting language where as Java is more for desktop applications or the like. In typical use you need a web server for PHP, for Java you don't. That said, I am well aware that you can use PHP to write non-web and even desktop applications. One other reason could be that Java is used to torture CS students, while PHP is poopooed as something script kiddies use. Same question can be asked about ASP.NET, that in no way does anything better than PHP, especially not performance. I attended a Java course at university and eventually dropped out and changed majors. I did ANSI C before and that was already more painful than necessary. Java topped that by a mile. I have no idea why developers pick Java. I find it kludgey and the development tools stink, but apparently it is good enough to bring us awesome software like OpenOffice. For years I always found that I hate programming and programming hates me...until I came across PHP. It just makes sense (OK, except for some of the date functions that were written half by Americans and half by Europeans using their date format respectively). Any other reasons? Java is Sun and PHP is, hmmmm, Zend? Na, there are plenty others. Java is Eclipse and PHP is, hmmmmm, can think of three or four great IDEs from freebie (Waterproof) to we charge you for every dot release (NuSphere). Nobody gets fired for using Java or .NET....unless you are hired to do PHP I could see that it is a tough sell to the mindless preventors of IT services. David From monalisa20042006 at gmail.com Wed Aug 12 09:24:29 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Wed, 12 Aug 2009 16:24:29 +0300 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A82A8C7.7000208@gmx.net> References: <4A82921D.7000908@reuel.net> <4A82A8C7.7000208@gmx.net> Message-ID: Java is an interpreted and complied language in the same time while php is only interpreted as it's a scripting language so java provides extra layer of security over php plus java can be used to program anything you can watch the javaone conference James Gosling toy show and see what java does it's used for desktop, web, mobile devices while php can't do any except the web and with the notice I said before. Mona Web Developer Development Group mona.borham at webworxcorp.com USA Toll Free Phone: 866.376.9679 USA Toll Free Fax: 866.543.2014 Outside USA Phone: 314.480.4545 On Wed, Aug 12, 2009 at 2:34 PM, David Krings wrote: > Leam Hall wrote: > >> Gang, I'll confess that I'm happy to support Java as it provides lots of >> reasons to upgrade hardware and buy newer/faster machines. However, from a >> systems engineering standpoint, I'm baffled by the recurring inefficiency of >> hundreds of corporate programmers... >> >> What does Java provide that PHP can't do faster and with lighter resource >> usage? >> > > Don't know in detail, but my guess is that PHP is thought of about to be a > pure web only scripting language where as Java is more for desktop > applications or the like. In typical use you need a web server for PHP, for > Java you don't. That said, I am well aware that you can use PHP to write > non-web and even desktop applications. > One other reason could be that Java is used to torture CS students, while > PHP is poopooed as something script kiddies use. Same question can be asked > about ASP.NET, that in no way does anything better than PHP, especially > not performance. > > I attended a Java course at university and eventually dropped out and > changed majors. I did ANSI C before and that was already more painful than > necessary. Java topped that by a mile. I have no idea why developers pick > Java. I find it kludgey and the development tools stink, but apparently it > is good enough to bring us awesome software like OpenOffice. For years I > always found that I hate programming and programming hates me...until I came > across PHP. It just makes sense (OK, except for some of the date functions > that were written half by Americans and half by Europeans using their date > format respectively). > > Any other reasons? Java is Sun and PHP is, hmmmm, Zend? Na, there are > plenty others. Java is Eclipse and PHP is, hmmmmm, can think of three or > four great IDEs from freebie (Waterproof) to we charge you for every dot > release (NuSphere). Nobody gets fired for using Java or .NET....unless you > are hired to do PHP I could see that it is a tough sell to the mindless > preventors of IT services. > > > > David > > _______________________________________________ > 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 paul at devonianfarm.com Wed Aug 12 10:02:31 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 12 Aug 2009 10:02:31 -0400 Subject: [nycphp-talk] Looking For Search Engine Optimization SEO Method In-Reply-To: References: Message-ID: <4A82CB77.6070103@devonianfarm.com> Mangesh Sathe wrote: > hello everyone, > > this is Mangesh Sathe > I am working on SEO Search engine Optimization. > are there any tools available for SEO or websites for SEO? > what are the basic steps required for SEO or shud i make any change in > source code. > Start with http://www.bluehatseo.com/seo-empire-part-1/ and read everything on that site. Then do some experiments and read that site all over again. I know it's a site for sore eyes, and it's very hard to really understand, and about 20% of it is crazy and wrong, but 80% of it is brilliant truth -- once you start to apply it you'll realize that. Few people have mastered it, but those who do get great results. Just don't tell Eli I sent you. From paul at devonianfarm.com Wed Aug 12 10:35:29 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 12 Aug 2009 10:35:29 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <51BB40AB-9A44-4953-B00D-CCD0E96B8DC4@gmail.com> References: <4A82921D.7000908@reuel.net> <51BB40AB-9A44-4953-B00D-CCD0E96B8DC4@gmail.com> Message-ID: <4A82D331.5020705@devonianfarm.com> Matt Williams wrote: > On Aug 12, 2009, at 5:57, Leam Hall wrote: > >> What does Java provide that PHP can't do faster and with lighter >> resource usage? > > Concurrency and threading to name a couple... I've got a system that's gotten complicated enough that it's "outgrowing" PHP. One big advantage in PHP is that you can get more productivity out of rookie programmers. It takes a good programmer 1 1/2 years to be able to produce usable Java, and some programmers never get good at it. The ideas in this system are complicated enough that I think I'd have a hard time hiring another programmer who could handle it, so the simplicity advantage of PHP is gone. I'm starting to want static types so that the compiler is watching my back and so that my IDE can do automated refactoring. I'm thinking of gradually moving to the JVM but using Scala instead of Java. After 2 years of working in C#, Java really seems like C#--. I mean, even PHP has closures today. Type inference, generics and other features in C# make Java seem like it's going backwards. On the other hand, if I'm doing my own sysadmin or paying somebody to sysadmin my systems, I don't want to be stuck in Windows. I know a lot of people think the type system of Scala is over-complicated, but after 2 years of lover's quarrels with the C# type system, Scala provided the general theory that informs my practice in C#. I'm interested in logic programming and other inference systems, as well as specialized databases: there's a lot of that written in Java. Java's never quite going to have the efficiency of C, but it's better for systems work than PHP. If I feel the need for scripting there's always Groovy, Jython, etc. My big beef with the JVM (and the CLR) is the UTF-16 scandal; perhaps I'm a cultural imperialist, but I process lots of text (billions and billions of characters) that is mainly: (i) us-ascii, (ii) iso-latin-1, and (iii) Unicode that is mainly us-ascii with occasional spattering of iso-latin-1 and other unicode characters For me, UTF-8 encodes text at about (1+epsilon) bytes per character; the JVM and CLR encode text at (2+epsilon) bytes per characters. A few years ago, when I was stuck on 32-bit machines, that was often the difference between a program that could run in RAM and a program that couldn't. Since text processing is limited by memory bandwidth, it often means large text-processing programs run about twice as slow on the JVM as they do in UTF-8 based environments. What makes it a scandal is that UTF-16 pretends to be a fixed-width encoding when it really isn't. Code that works correctly with, say, English or Japanese will break when you're processing Chinese or mathematical characters. Code written with the fast random access that Java provides doesn't generalize to all languages, so you need to fall back to the same sequential access methods that you use handling UTF-8 in PHP. A big advantage of PHP for unicode handling is that it "does no harm;" I've often seen Java and CLR systems fail seriously because of limitations in how they handle Unicode characters, particularly when dealing with junky input data. From mitch.pirtle at gmail.com Wed Aug 12 10:47:44 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Wed, 12 Aug 2009 10:47:44 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A82D331.5020705@devonianfarm.com> References: <4A82921D.7000908@reuel.net> <51BB40AB-9A44-4953-B00D-CCD0E96B8DC4@gmail.com> <4A82D331.5020705@devonianfarm.com> Message-ID: <330532b60908120747w45dc3708i21a6e870c003bfe5@mail.gmail.com> Recently I've taken to the approach of using PHP as the front end application scripting language, and building out RESTful services using java. This lets you take advantage of the best of both - PHP for fast prototyping, and java for the 'heavy lifting' behind a REST layer. I was recently asked what my 3 biggest complaints were about PHP, and one of them was not having an app container for a stateful service, like some sort of PHP equivalent to jetty etc. -- Mitch On Wed, Aug 12, 2009 at 10:35 AM, Paul A Houle wrote: > Matt Williams wrote: >> >> On Aug 12, 2009, at 5:57, Leam Hall wrote: >> >>> What does Java provide that PHP can't do faster and with lighter resource >>> usage? >> >> Concurrency and threading to name a couple... > > ? I've got a system that's gotten complicated enough that it's "outgrowing" > PHP. ?One big advantage in PHP is that you can get more productivity out of > rookie programmers. ?It takes a good programmer 1 1/2 years to be able to > produce usable Java, ?and some programmers never get good at it. ?The ideas > in this system are complicated enough that I think I'd have a hard time > hiring another programmer who could handle it, ?so the simplicity advantage > of PHP is gone. ?I'm starting to want static types so that the compiler is > watching my back and so that my IDE can do automated refactoring. > > ? I'm thinking of gradually moving to the JVM but using Scala instead of > Java. ?After 2 years of working in C#, ?Java really seems like C#--. ?I > mean, ?even PHP has closures today. ?Type inference, ?generics and other > features in C# make Java seem like it's going backwards. ?On the other hand, > ?if I'm doing my own sysadmin or paying somebody to sysadmin my systems, ?I > don't want to be stuck in Windows. ?I know a lot of people think the type > system of Scala is over-complicated, ?but after 2 years of lover's quarrels > with the C# type system, ?Scala provided the general theory that informs my > practice in C#. > > ?I'm interested in logic programming and other inference systems, ?as well > as specialized databases: ?there's a lot of that written in Java. ?Java's > never quite going to have the efficiency of C, ?but it's better for systems > work than PHP. ?If I feel the need for scripting there's always Groovy, > ?Jython, ?etc. > > ? My big beef with the JVM (and the CLR) is the UTF-16 scandal; ?perhaps I'm > a cultural imperialist, ?but I process lots of text (billions and billions > of characters) that is mainly: > > (i) us-ascii, > (ii) iso-latin-1, ?and > (iii) Unicode that is mainly us-ascii with occasional spattering of > iso-latin-1 and other unicode characters > > For me, ?UTF-8 encodes text at about (1+epsilon) bytes per character; ?the > JVM and CLR encode text at (2+epsilon) bytes per characters. ?A few years > ago, ?when I was stuck on 32-bit machines, ?that was often the difference > between a program that could run in RAM and a program that couldn't. ?Since > text processing is limited by memory bandwidth, ?it often means large > text-processing programs run about twice as slow on the JVM as they do in > UTF-8 based environments. > > What makes it a scandal is that UTF-16 pretends to be a fixed-width encoding > when it really isn't. ?Code that works correctly with, ?say, ?English or > Japanese will break when you're processing Chinese or mathematical > characters. ?Code written with the fast random access that Java provides > doesn't generalize to all languages, ?so you need to fall back to the same > sequential access methods that you use handling UTF-8 in PHP. > > A big advantage of PHP for unicode handling is that it "does no harm;" ?I've > often seen Java and CLR systems fail seriously because of limitations in how > they handle Unicode characters, ?particularly when dealing with junky input > data. > _______________________________________________ > 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 Wed Aug 12 11:05:02 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 12 Aug 2009 11:05:02 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <330532b60908120747w45dc3708i21a6e870c003bfe5@mail.gmail.com> References: <4A82921D.7000908@reuel.net> <51BB40AB-9A44-4953-B00D-CCD0E96B8DC4@gmail.com> <4A82D331.5020705@devonianfarm.com> <330532b60908120747w45dc3708i21a6e870c003bfe5@mail.gmail.com> Message-ID: <4A82DA1E.4050008@devonianfarm.com> Mitch Pirtle wrote: > Recently I've taken to the approach of using PHP as the front end > application scripting language, and building out RESTful services > using java. This lets you take advantage of the best of both - PHP for > fast prototyping, and java for the 'heavy lifting' behind a REST > layer. > > I was recently asked what my 3 biggest complaints were about PHP, and > one of them was not having an app container for a stateful service, > like some sort of PHP equivalent to jetty etc. > Watch out, statefulness can be a road to hell. The lack of state in one of the reasons why PHP apps are trouble free. Cold Fusion, ASP.NET, JSP and a lot of related environments tempt people to be sloppy about state and these often create horrible problems. From dlmerryweather at gmail.com Wed Aug 12 12:01:52 2009 From: dlmerryweather at gmail.com (David Merryweather) Date: Wed, 12 Aug 2009 11:01:52 -0500 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A82921D.7000908@reuel.net> References: <4A82921D.7000908@reuel.net> Message-ID: <793b2bec0908120901q3edc5770i871cf34f55fbbec9@mail.gmail.com> Leam, A good read that may answer some of your questions... http://phplens.com/phpeverywhere/node/view/15 On Wed, Aug 12, 2009 at 4:57 AM, Leam Hall wrote: > Gang, I'll confess that I'm happy to support Java as it provides lots of > reasons to upgrade hardware and buy newer/faster machines. However, from a > systems engineering standpoint, I'm baffled by the recurring inefficiency of > hundreds of corporate programmers... > > What does Java provide that PHP can't do faster and with lighter resource > usage? > > Leam > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- David Merryweather Vice President of Information Technologies Creative Education Institute, Inc. From ioplex at gmail.com Wed Aug 12 13:42:51 2009 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 12 Aug 2009 13:42:51 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A82921D.7000908@reuel.net> References: <4A82921D.7000908@reuel.net> Message-ID: <78c6bd860908121042o4fe2c4ffvefceaea13fb5a580@mail.gmail.com> On Wed, Aug 12, 2009 at 5:57 AM, Leam Hall wrote: > Gang, I'll confess that I'm happy to support Java as it provides lots of > reasons to upgrade hardware and buy newer/faster machines. However, from a > systems engineering standpoint, I'm baffled by the recurring inefficiency of > hundreds of corporate programmers... > > What does Java provide that PHP can't do faster and with lighter resource > usage? The reasons are mostly non-technical. Java and PHP are both fine languages. But Java had a strong position in the late 90's with backing from what was once a highly respected company. At that same time PHP was still held together with duct tape and string. Today the Java and PHP are much more competitive which is why it has provoked such contentious debate. Java and virtually all third party libraries are almost completely platform independent. If you write something on Windows, it has a very good chance of running on Linux. But PHP applications are faster. This is in large part due to the fact that PHP is mostly a glue language for C and it's various libraries which are optimized for the platform on which they were compiled. But again, the reasons for choosing PHP vs. Java are usually not technical at all. My personal opinion is that if you're a Windows shop and you treat software development like a logistical problem and you need to hire and fire programmers like a commodity, then use Java. It's much more forgiving than PHP. To be effective with PHP you must really understand PHP well. If you're really good at PHP it can be much more powerful than Java. Of course most people fall into the Windows commodity programmer category and so I predict Java will be around for a while. But PHP will continue to dominate with power programmers. Mike -- Michael B Allen Java Active Directory Integration http://www.ioplex.com/ From paul at devonianfarm.com Wed Aug 12 14:33:02 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 12 Aug 2009 14:33:02 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <78c6bd860908121042o4fe2c4ffvefceaea13fb5a580@mail.gmail.com> References: <4A82921D.7000908@reuel.net> <78c6bd860908121042o4fe2c4ffvefceaea13fb5a580@mail.gmail.com> Message-ID: <4A830ADE.4010805@devonianfarm.com> Michael B Allen wrote: > My personal opinion is that if you're a Windows shop and you treat > software development like a logistical problem and you need to hire > and fire programmers like a commodity, then use Java. It's much more > forgiving than PHP. To be effective with PHP you must really > understand PHP well. If you're really good at PHP it can be much more > powerful than Java. Of course most people fall into the Windows > commodity programmer category and so I predict Java will be around for > a while. But PHP will continue to dominate with power programmers. > > Mike > > I'd say it's the opposite. Java's improved more in the last ten years than PHP has (although PHP certainly has) http://blogs.law.harvard.edu/philg/2003/09/20/java-is-the-suv-of-programming-tools/ Back in 2003, Java Frameworks such as Struts were part of the problem, not part of the solution. Much better frameworks exist today, and there's much more of a "framework culture" that people understand how to build apps well. It's impossible to explain the power of the Eclipse/Java IDE to anyone who works primarily in dynamic languages. I mean, it does things that PHP IDEs can't even dream of doing: first of all, Eclipse overcomes most of the verbosity of Java that makes Java painful to work on. You can click on a 'create class' button and it creates a file in the right place for the namespace it's in, fills in the headers and all that. Renaming a class in Java is a big pain manually, but can be done in two clicks in Eclipse: Eclipse renames all the instances of the class, renames the file. Refactoring operations that could take a few hours in PHP or in Java w/o an IDE can be done in under a minute... and never a mistake. What I'd really like is a less verbose language, like Scala, with the good IDE. There's no reason Eclipse/Scala couldn't be as good as Eclipse/Java, except that a lot of people just don't appreciate what an advance Eclipse/Java is over vi. It's much easier to be productive, at a low level, in PHP than it is in Java. I've given business people 1-day bootcamp training in PHP and that's been enough for them to make small changes to their sites. Systems like Smarty are a big waste of time in my opinion, since graphic designers can quickly learn enough PHP to write templates -- and they find it's a useful skill. Personally, I'm working on a product that has a complex meta-object system: it's kind of a CMS for robots, or an object-relational mapper turned inside out. It layers object-relational and semweb capabilities over mysql and enables extreme re-use of code and database schemas. It heavily uses the dynamic dispatch capabilities in PHP, but the core of it is complicated enough that I wish I had the help of a compiler and IDE in maintaining it. If I were a Windows shop, I'd go for ASP.NET. C# is a wonderful language, a living language. Microsoft is continually improving it, while it seems Java is stuck in reverse. Linq is just great, and the C# generics system makes Java generics look like a joke. There's a lot of junk in ASP.NET, but if you avoid the junk, it's a system that's better in J2EE in all ways (Java Web Faces is as much of a stinker as ASP.NET Web Forms) The big trouble is that people from straight-windows backgrounds can't tell what's junk and what's not -- w/ a decade of PHP experience (and a healthy phobia of accidentally being stateful) I've found it easy to find the good stuff in ASP.NET; recent versions of IIS do a good job of surviving exceptional events inside ASP.NET, better than most Tomcat installations I've seen. Of course, ASP.NET means you're stuck with Windows... If you can't accept that, you've got to use something else. From ajai at bitblit.net Wed Aug 12 14:52:27 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 12 Aug 2009 14:52:27 -0400 (EDT) Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A830ADE.4010805@devonianfarm.com> Message-ID: On Wed, 12 Aug 2009, Paul A Houle wrote: > It's impossible to explain the power of the Eclipse/Java IDE to > anyone who works primarily in dynamic languages. I mean, it does > things that PHP IDEs can't even dream of doing: first of all, Eclipse > overcomes most of the verbosity of Java that makes Java painful to work > on. You can click on a 'create class' button and it creates a file in > the right place for the namespace it's in, fills in the headers and all > that. Renaming a class in Java is a big pain manually, but can be done > in two clicks in Eclipse: Eclipse renames all the instances of the > class, renames the file. Refactoring operations that could take a few > hours in PHP or in Java w/o an IDE can be done in under a minute... and > never a mistake. Of course, you're ignoring the fact that these have little to do with Java - IDEs exist for PHP too. Personally, I dislike IDEs but to each their own. -- Aj. From ioplex at gmail.com Wed Aug 12 15:01:31 2009 From: ioplex at gmail.com (Michael B Allen) Date: Wed, 12 Aug 2009 15:01:31 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A830ADE.4010805@devonianfarm.com> References: <4A82921D.7000908@reuel.net> <78c6bd860908121042o4fe2c4ffvefceaea13fb5a580@mail.gmail.com> <4A830ADE.4010805@devonianfarm.com> Message-ID: <78c6bd860908121201p673f247dmade23fac517960e9@mail.gmail.com> On Wed, Aug 12, 2009 at 2:33 PM, Paul A Houle wrote: > ? If I were a Windows shop, ?I'd go for ASP.NET. ?C# is a wonderful > language, ?a living language. ?Microsoft is continually improving it, ?while > it seems Java is stuck in reverse. ?Linq is just great, ?and the C# generics > system makes Java generics look like a joke. ?There's a lot of junk in > ASP.NET, ?but if you avoid the junk, ?it's a system that's better in J2EE in > all ways (Java Web Faces is as much of a stinker as ASP.NET Web Forms) ?The > big trouble is that people from straight-windows backgrounds can't tell > what's junk and what's not -- w/ a decade of PHP experience (and a healthy > phobia of accidentally being stateful) I've found it easy to find the good > stuff in ASP.NET; ?recent versions of IIS do a good job of surviving > exceptional events inside ASP.NET, ?better than most Tomcat installations > I've seen. > > ? Of course, ?ASP.NET means you're stuck with Windows... ?If you can't > accept that, ?you've got to use something else. I agree with you about this. Microsoft has always had good language support. C# as a language is clearly superior to Java. However, Java still has a huge advantage in that it is platform independent. C# may be an ISO standard but that is meaningless if the class libraries are tied to the Windows platform. If a good platform independent implementation of C# with good platform independent libraries turned up, it could do very well. I also agree with you about all the "junk". C# and Java both suffer the "fluffy programming" problem. The number of classes and half-baked attempts at OO abstractions is unnecessarily complex and nonuniform. The number of C# assemblies is staggering. Why does logging in Java need 17 classes with all sorts of complex OO relations? That's just ridiculous. Mike -- Michael B Allen Java Active Directory Integration http://www.ioplex.com/ From paul at devonianfarm.com Wed Aug 12 15:59:44 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 12 Aug 2009 15:59:44 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: References: Message-ID: <4A831F30.30004@devonianfarm.com> Ajai Khattri wrote: > > Of course, you're ignoring the fact that these have little to do with Java > - IDEs exist for PHP too. > > Personally, I dislike IDEs but to each their own. > See, that's what PHPers, Pythoners, Ruby people always say... I did a lot of Java from 1996 to 1999 and then gave up on it for PHP. Recently I had to finish a GWT/J2EE app that somebody else started, and Eclipse/Java opened my eyes. Eclipse/PHP doesn't do anything vi doesn't do, except it has two buttons you can click on to start and stop your web server. Woooo... I'm so impressed. All you get from Eclipse/PHP is increased startup time. No wonder why PHPers think Eclipse is worthless, because Eclipse/PHP ~is~ worthless. Eclipse has seriously damaged it's brand by coming out with shovelware products for PHP, Ruby, Python, etc. They really ought to be like the Apple App Store and ban that stuff so people realize that Eclipse/Java is cool. Eclipse/Java does something different from every other Eclipse/X I've seen. It parses your code, understands something about it, and helps you. For instance, if you write objectInstance.AMethodThatDoesNotExist() a little symbol appears on the side of the screen: click on it and it will offer you choices: for instance, it will correct typos if you type something that is almost like an existing method. You can create the method with one click, or you can change the access level of the method if you're not currently allowed to access it. The UI is good enough that it feels like a help, not a hindrance. The IDE highlights methods and variables that don't get used; there are at least 20 different automated refactorings that make changes (like pushing methods up & down a class hierarchy or renaming methods) automatically. Yes, you can just click on the definition of a method, class, or variable, type in a new name, and it gets changed everywhere... In seconds, without ever making mistakes. All of that helps compensate for the additional artifacts that you need to write Java. Eclipse/Java also has a debugger that ~works~. There are a lot of reasons for it, but I've never been able to build a PHP debugging system with a PHP IDE that really works. No more having debugging "echo" statements winding up in production code... Visual Studio/C# is maybe 50% as good as Eclipse/Java, and the ReSharper product from JetBrains gets it up to 90%. From paul at devonianfarm.com Wed Aug 12 16:07:59 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 12 Aug 2009 16:07:59 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <78c6bd860908121201p673f247dmade23fac517960e9@mail.gmail.com> References: <4A82921D.7000908@reuel.net> <78c6bd860908121042o4fe2c4ffvefceaea13fb5a580@mail.gmail.com> <4A830ADE.4010805@devonianfarm.com> <78c6bd860908121201p673f247dmade23fac517960e9@mail.gmail.com> Message-ID: <4A83211F.4050208@devonianfarm.com> Michael B Allen wrote: > I also agree with you about all the "junk". C# and Java both suffer > the "fluffy programming" problem. The number of classes and half-baked > attempts at OO abstractions is unnecessarily complex and nonuniform. > The number of C# assemblies is staggering. Why does logging in Java > need 17 classes with all sorts of complex OO relations? That's just > ridiculous. > It's enterprise-itis, and it's not the fault of the language. Unfortunately, companies like Sun and Microsoft will hire people who have systems programming experience but no real experience with the problem domain to develop tools. Requirement #1 is putting as many acronyms in the marketing material as possible. Requirement #2 is making it possible to interface with a large number of legacy system that ought to be taken behind the shed and shot. Security, Reliablity, Performance and developer convenience rank somewhere around Requirement #19482. You'd get very different results if the system was written by a battle hardened IT sysadmin rather than a couple of college kids and Bangalore Bangers headed up a product manager hired away from a breakfast cereal company. ColdFusion, ASP.NET and other commercial web systems appear to be built by smart people who'd never built web applications. If they'd hired people who'd spent a decade writing webapps, they'd understand the unwritten standards behind web sites that work. However, people who know how to build webaps and do systems work are busy. From tmpvar at gmail.com Wed Aug 12 16:08:52 2009 From: tmpvar at gmail.com (Elijah Insua) Date: Wed, 12 Aug 2009 16:08:52 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A831F30.30004@devonianfarm.com> References: <4A831F30.30004@devonianfarm.com> Message-ID: <2b4feca10908121308y248494ccm8c74285838648b4d@mail.gmail.com> > Eclipse/PHP doesn't do anything vi doesn't do, except it has two buttons > you can click on to start and stop your web server. Woooo... I'm so > impressed. All you get from Eclipse/PHP is increased startup time. No > wonder why PHPers think Eclipse is worthless, because Eclipse/PHP ~is~ > worthless. Eclipse has seriously damaged it's brand by coming out with > shovelware products for PHP, Ruby, Python, etc. They really ought to be > like the Apple App Store and ban that stuff so people realize that > Eclipse/Java is cool. > I'm pretty sure you are talking about using eclipse as a text editor? There are a couple plugins that make eclipse intelligent about your php project. PHPEclipse does do code hinting, I believe PDT does as well. Not to mention netbeans with its PHP Plugin, or how about Zend Studio / Komodo / VS.PHP. They all have code hinting/"intellisense" Eclipse/Java also has a debugger that ~works~. There are a lot of reasons > for it, but I've never been able to build a PHP debugging system with a PHP > IDE that really works. No more having debugging "echo" statements winding > up in production code... > there are two debugging "systems" you can use with php. XDebug and DBG, PHPEclipse and Netbeans/PHP both have support for this. http://www.netbeans.org/features/php/ -- Elijah -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at devonianfarm.com Wed Aug 12 16:55:11 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Wed, 12 Aug 2009 16:55:11 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <2b4feca10908121308y248494ccm8c74285838648b4d@mail.gmail.com> References: <4A831F30.30004@devonianfarm.com> <2b4feca10908121308y248494ccm8c74285838648b4d@mail.gmail.com> Message-ID: <4A832C2F.4000403@devonianfarm.com> Elijah Insua wrote: > > I'm pretty sure you are talking about using eclipse as a text editor? > There are a couple plugins that make eclipse intelligent about your > php project. > > PHPEclipse does do code hinting, I believe PDT does as well. Not to > mention netbeans with its PHP Plugin, or how about Zend Studio / > Komodo / VS.PHP. They all have code hinting/"intellisense" > Code hinting doesn't count for that much. I type fast, I know the built-in PHP methods like the back of my hand, and these things can't understand the classes and functions that I write well enough to be useful for artifacts that aren't part of the language. To be fair I make matters worse by depending on heavily on autoloading as well as computed file, method, function and class names. A useful PHP IDE for me would need to not only understand plain PHP, but also be programmable w/ rules to describe the naming conventions used in my framework. There's a world of difference between the gimmicks in the PHP editors I've seen and what Eclipse/Java does, > > there are two debugging "systems" you can use with php. XDebug and > DBG, PHPEclipse and Netbeans/PHP both have support for this. > > > http://www.netbeans.org/features/php/ > I know. I've never gotten either of those to work effectively. There's always been some problem, like the plug-in wouldn't build on the target machine or it would built but cause Apache to crash, or there was a firewall in the way. If I was getting paid to screw around with debuggers and write patches and all that I might be able to make it work, but I've found that Java debugging and C# debugging just work... From ajai at bitblit.net Wed Aug 12 18:35:30 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 12 Aug 2009 18:35:30 -0400 (EDT) Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A831F30.30004@devonianfarm.com> Message-ID: On Wed, 12 Aug 2009, Paul A Houle wrote: > a little symbol appears on the side of the screen: click on it and > it will offer you choices: for instance, it will correct typos if you Syntax coloring usually tells me Ive mistyped and I see the typo right away. I dont want to waste a few seconds looking at messages and/or popups.. > type something that is almost like an existing method. You can create > the method with one click, or you can change the access level of the > method if you're not currently allowed to access it. The UI is good > enough that it feels like a help, not a hindrance. The IDE highlights > methods and variables that don't get used; there are at least 20 > different automated refactorings that make changes (like pushing methods > up & down a class hierarchy or renaming methods) automatically. Yes, > you can just click on the definition of a method, class, or variable, > type in a new name, and it gets changed everywhere... In seconds, > without ever making mistakes. All of that helps compensate for the > additional artifacts that you need to write Java. My dislike of IDEs has little to do with the features, but more to do with the fact that *for me*, having to move my hands away from the keyboard to click the mouse buttons is an annoyance and a waste of time. This is why I learn all the keyboard shortcuts and add utilities that give me stuff I cannot normally control from the keyboard (like switching to console Quake-style). I use a Mac all day and use the mouse plenty, but when Im in the zone coding its just me and the keyboard. > Eclipse/Java also has a debugger that ~works~. There are a lot of > reasons for it, but I've never been able to build a PHP debugging > system with a PHP IDE that really works. No more having debugging > "echo" statements winding up in production code... And you've probably never used XDebug or FirePHP. -- Aj. From ramons at gmx.net Wed Aug 12 18:41:27 2009 From: ramons at gmx.net (David Krings) Date: Wed, 12 Aug 2009 18:41:27 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: References: Message-ID: <4A834517.7060608@gmx.net> Ajai Khattri wrote: > > Personally, I dislike IDEs but to each their own. Personally, I love a good IDE. For PHP I cannot think of a better one than NuSphere, even though I dispise their pricing model, which is still bargain bin compared to Zend Studio (which I could never figure out). Sure, you can use some cryptic editor and it really gets your hands dirty, but you are also less efficient. Just things like code completion reduce the amount of silly typing errors. Can't get that from a text editor. Also, IDEs like NuSphere come with an integrated server, so you can right away see what you are doing. Maybe the assembler developers who write firmware are fine with a simple editor that has some really basic functions, but anything higher than that, why wouldn't one want to use an IDE? David From oorza2k5 at gmail.com Wed Aug 12 19:00:02 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Wed, 12 Aug 2009 19:00:02 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A832C2F.4000403@devonianfarm.com> References: <4A831F30.30004@devonianfarm.com> <2b4feca10908121308y248494ccm8c74285838648b4d@mail.gmail.com> <4A832C2F.4000403@devonianfarm.com> Message-ID: <68de37340908121600r33ee31f6if4de093a1c42540a@mail.gmail.com> On Wed, Aug 12, 2009 at 4:55 PM, Paul A Houle wrote: > Elijah Insua wrote: >> >> I'm pretty sure you are talking about using eclipse as a text editor? >> There are a couple plugins that make eclipse intelligent about your php >> project. >> >> PHPEclipse does do code hinting, I believe PDT does as well. ?Not to >> mention netbeans with its PHP Plugin, or how about Zend Studio / Komodo / >> VS.PHP. ?They all have code hinting/"intellisense" >> > ? Code hinting doesn't count for that much. ?I type fast, ?I know the > built-in PHP methods like the back of my hand, ?and these things can't > understand the classes and functions that I write well enough to be useful > for artifacts that aren't part of the language. > > ? To be fair I make matters worse by depending on heavily on autoloading as > well as computed file, method, ?function and class names. ?A useful PHP IDE > for me would need to not only understand plain PHP, ?but also be > programmable w/ rules to describe the naming conventions used in my > framework. > > ? There's a world of difference between the gimmicks in the PHP editors I've > seen and what Eclipse/Java does, >> >> there are two debugging "systems" you can use with php. ?XDebug and DBG, >> PHPEclipse and Netbeans/PHP both have support for this. >> >> >> http://www.netbeans.org/features/php/ >> > ? I know. ?I've never gotten either of those to work effectively. ?There's > always been some problem, ?like the plug-in wouldn't build on the target > machine or it would built but cause Apache to crash, ?or there was a > firewall in the way. ?If I was getting paid to screw around with debuggers > and write patches and all that I might be able to make it work, ?but I've > found that Java debugging and C# debugging just work... > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > As far as code completion and hinting, if you write PHPDoc tags, the assistance available in Zend Studio rivals that of Eclipse/Java. Without the tags, it's not as useful (no parameter type-hints or return type hinting) as it is with them, but it can still "learn" your project layout and use classes / methods that you've already defined. As far as dynamic class names and function names, I don't recall Eclipse/Java supporting that, so it's not really fair to take that away from PHP IDE's. With regards to debugging, I don't know how you've attempted to setup remote debugging - which has to be what you're talking about with regards to crApache, but something along the lines of "pecl install xdebug", add the lines to php.ini and forward some ports in my router has always worked for me. And even if you have reasons to not have remote debugging support all the time, the built in debugging of both Zend Studio and PDT works fine. When I started writing PHP, I initially tried out PDT, which was relatively weak at that point and went with working in a syntax-highlighting only editor for a while. When I found that Zend Studio had switched to being based on Eclipse and I tried it, to find that it's the closest to Eclipse/Java of any IDE I've tried. It's not as useful as E/J is, but that's also not entirely the fault of the IDE, but also the language. Things like return types, what exceptions are thrown, parameter types, etc. are easily available and parsed from Java, not so much from PHP, because those declarations have to be made in PHPDoc blocks. I think, overall, Java is a language that's a lot more conducive to having a full featured and helpful IDE than PHP is, well, even more so than most languages. PHP hasn't been a serious language for very long (I don't consider PHP <5 to be a serious language), so I'd give it some time before I started comparing apples and oranges. From ben at projectskyline.com Wed Aug 12 19:50:07 2009 From: ben at projectskyline.com (Ben Sgro) Date: Wed, 12 Aug 2009 19:50:07 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A82921D.7000908@reuel.net> References: <4A82921D.7000908@reuel.net> Message-ID: <4A83552F.2040609@projectskyline.com> > What does Java provide that PHP can't do faster and with lighter resource usage? XSLT 2.0 support. PHP does not. - Ben Leam Hall wrote: > Gang, I'll confess that I'm happy to support Java as it provides lots > of reasons to upgrade hardware and buy newer/faster machines. However, > from a systems engineering standpoint, I'm baffled by the recurring > inefficiency of hundreds of corporate programmers... > > What does Java provide that PHP can't do faster and with lighter > resource usage? > > Leam > _______________________________________________ > 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 Aug 12 20:59:06 2009 From: consult at covenantedesign.com (CED) Date: Wed, 12 Aug 2009 20:59:06 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A831F30.30004@devonianfarm.com> References: <4A831F30.30004@devonianfarm.com> Message-ID: <4A83655A.6070802@covenantedesign.com> Paul A Houle wrote: > Ajai Khattri wrote: >> >> Of course, you're ignoring the fact that these have little to do with >> Java - IDEs exist for PHP too. >> >> Personally, I dislike IDEs but to each their own. >> > See, that's what PHPers, Pythoners, Ruby people always say... I > did a lot of Java from 1996 to 1999 and then gave up on it for PHP. > Recently I had to finish a GWT/J2EE app that somebody else started, > and Eclipse/Java opened my eyes. > > Eclipse/PHP doesn't do anything vi doesn't do, except it has two > buttons you can click on to start and stop your web server. Woooo... > I'm so impressed. All you get from Eclipse/PHP is increased startup > time. No wonder why PHPers think Eclipse is worthless, because > Eclipse/PHP ~is~ worthless. Eclipse has seriously damaged it's brand > by coming out with shovelware products for PHP, Ruby, Python, etc. > They really ought to be like the Apple App Store and ban that stuff so > people realize that Eclipse/Java is cool. > > Eclipse/Java does something different from every other Eclipse/X > I've seen. It parses your code, understands something about it, and > helps you. For instance, if you write > > objectInstance.AMethodThatDoesNotExist() > > a little symbol appears on the side of the screen: click on it and > it will offer you choices: for instance, it will correct typos if > you type something that is almost like an existing method. You can > create the method with one click, or you can change the access level > of the method if you're not currently allowed to access it. The UI is > good enough that it feels like a help, not a hindrance. The IDE > highlights methods and variables that don't get used; there are at > least 20 different automated refactorings that make changes (like > pushing methods up & down a class hierarchy or renaming methods) > automatically. Yes, you can just click on the definition of a > method, class, or variable, type in a new name, and it gets > changed everywhere... In seconds, without ever making mistakes. All > of that helps compensate for the additional artifacts that you need to > write Java. > > Eclipse/Java also has a debugger that ~works~. There are a lot of > reasons for it, but I've never been able to build a PHP debugging > system with a PHP IDE that really works. No more having debugging > "echo" statements winding up in production code... > > Visual Studio/C# is maybe 50% as good as Eclipse/Java, and the > ReSharper product from JetBrains gets it up to 90%. > > > > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > > Eclipse/Python does the same thing -- 995 Maple Hill Road Castleton, New York 12033 518-331-5061 Consult at CovenanteDesign.com From consult at covenantedesign.com Wed Aug 12 21:00:47 2009 From: consult at covenantedesign.com (CED) Date: Wed, 12 Aug 2009 21:00:47 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A83552F.2040609@projectskyline.com> References: <4A82921D.7000908@reuel.net> <4A83552F.2040609@projectskyline.com> Message-ID: <4A8365BF.10802@covenantedesign.com> Ben Sgro wrote: > > > What does Java provide that PHP can't do faster and with lighter > resource usage? > > XSLT 2.0 support. PHP does not. > > - Ben > > Leam Hall wrote: >> Gang, I'll confess that I'm happy to support Java as it provides lots >> of reasons to upgrade hardware and buy newer/faster machines. >> However, from a systems engineering standpoint, I'm baffled by the >> recurring inefficiency of hundreds of corporate programmers... >> >> What does Java provide that PHP can't do faster and with lighter >> resource usage? >> >> Leam >> _______________________________________________ >> 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 > > > Not to mention the JMF... and hundreds of others... there is no comparison, on the web PHP rules, on the system, Java. -- 995 Maple Hill Road Castleton, New York 12033 518-331-5061 Consult at CovenanteDesign.com From ps at blu-studio.com Wed Aug 12 21:23:32 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Wed, 12 Aug 2009 21:23:32 -0400 Subject: [nycphp-talk] Migrate to Cloud Message-ID: <003a01ca1bb4$ac9eec40$05dcc4c0$@com> I'd like to start migrating to a cloud computing type of work style for myself. Essentially use my laptop w/ 500GB Passport HD (USB powered, no cord) to have the work software, but use google Apps for basic document and email. Google seems to have limits on their file sizes and types to store, so I've looked around for more free form cloud storage MSFT has a free Sky Drive - 25GB of cloud storage with a Live ID. There is also Live Mesh. Any other suggestions on a cloud storage resource? Strategy? Warmest regards, Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcampbell1 at gmail.com Wed Aug 12 22:48:42 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Wed, 12 Aug 2009 22:48:42 -0400 Subject: [nycphp-talk] Migrate to Cloud In-Reply-To: <003a01ca1bb4$ac9eec40$05dcc4c0$@com> References: <003a01ca1bb4$ac9eec40$05dcc4c0$@com> Message-ID: <8f0676b40908121948u3d8f6c33teb1dfdaf07bedbe7@mail.gmail.com> 2009/8/12 Peter Sawczynec : > Any other suggestions on a cloud storage resource? Strategy? I'd use something based on S3. It is cheap, reliable, proven, and going to be around forever. -John C. From ajai at bitblit.net Thu Aug 13 00:20:38 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 13 Aug 2009 00:20:38 -0400 (EDT) Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A834517.7060608@gmx.net> Message-ID: On Wed, 12 Aug 2009, David Krings wrote: > Sure, you can use some cryptic editor Cryptic to *you* perhaps... > and it really gets your hands dirty, but > you are also less efficient. Speak for yourself. With the right options and plugins, a good text editor is great - muscle memory means I dont to think about the act of editing but just focus on the code. And again, for *me* constantly switching between mouse and keyboard is totally inefficient. > Maybe the assembler developers who write firmware are fine with a simple > editor that has some really basic functions Actually I coded assembler languages when I was a kid too, and most good assembly language systems are more than just simple text editors... -- Aj. From parthatr at gmail.com Thu Aug 13 01:03:48 2009 From: parthatr at gmail.com (Partha Sarathy) Date: Thu, 13 Aug 2009 10:33:48 +0530 Subject: [nycphp-talk] E-commerce site Message-ID: <5fdd951b0908122203k34eeef5cqd127d97735b87d38@mail.gmail.com> Hi All, I am Parthasarathy. I planned to develop e-commerce site using open source tool. Suggest me the best open source tool like Magento, OSCommerce, OSCMax or Joomla with Virtuemart and so on. Expecting reply. -- T.R.Parthasarathy -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at blu-studio.com Thu Aug 13 06:34:02 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 13 Aug 2009 06:34:02 -0400 Subject: [nycphp-talk] Migrate to Cloud In-Reply-To: <8f0676b40908121948u3d8f6c33teb1dfdaf07bedbe7@mail.gmail.com> References: <003a01ca1bb4$ac9eec40$05dcc4c0$@com> <8f0676b40908121948u3d8f6c33teb1dfdaf07bedbe7@mail.gmail.com> Message-ID: <005301ca1c01$93fc4910$bbf4db30$@com> Quick reading, solid recent update with further info on corp. cloud and cloud backup initiatives including from Rackspace, Symantec... at this URL: http://searchstorage.techtarget.com/news/article/0,289142,sid5_gci134746 6,00.html 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 John Campbell Sent: Wednesday, August 12, 2009 10:49 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Migrate to Cloud 2009/8/12 Peter Sawczynec : > Any other suggestions on a cloud storage resource? Strategy? I'd use something based on S3. It is cheap, reliable, proven, and going to be around forever. -John C. _______________________________________________ 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 Thu Aug 13 07:16:49 2009 From: ramons at gmx.net (David Krings) Date: Thu, 13 Aug 2009 07:16:49 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: References: Message-ID: <4A83F621.8050008@gmx.net> Ajai Khattri wrote: > On Wed, 12 Aug 2009, David Krings wrote: > >> Sure, you can use some cryptic editor > > Cryptic to *you* perhaps... I know vi is the holy grail of editors, but I find it cryptic and unintuitive. Sure, after learning all the keyboard shortcuts that amount more to a scripting language you get a lot done, but I find it silly to spend more time on learning the tool than learning the trade..... unless I am a vi salesman. >> and it really gets your hands dirty, but >> you are also less efficient. > > Speak for yourself. With the right options and plugins, a good text editor > is great - muscle memory means I dont to think about the act of editing > but just focus on the code. And again, for *me* constantly > switching between mouse and keyboard is totally inefficient. I use NuSpehere and find that I do not constantly switch between keyboard and mouse. I use the mouse for tasks such as creating a new file in the desired location (browsing is faster using a mouse) or when scrolling through the code to set breakpoints. I don't think that an IDE forces one to use a mouse constantly. There are plenty of keyboard shortcuts and tab sequences that allow for working mouseless. And if you take a text editor and install add-ons and plugins to help along with coding it smells like IDE to me, at least the lines get blurred between IDE and text editor. What I like about NuSphere (and other PHP IDEs as well) is the integrated server, the properly working debugger, and with that the option to set breakpoints. I know I can accomplish that in other ways, but I tried to do so with Eclipse and it was a total nightmare. Things may have changed by now. By jolly, I'm not trying to make you a convert. I know of people who can compile code in the brains and if they had a network plug in their ears they wouldn't even need a PC. >> Maybe the assembler developers who write firmware are fine with a simple >> editor that has some really basic functions > > Actually I coded assembler languages when I was a kid too, and most good > assembly language systems are more than just simple text editors... I learned assembler on the Z80 and the editor that we had was really not much more than a somewhat better text editor. It may depend on the development kit that is available for the platform. David From mitch.pirtle at gmail.com Thu Aug 13 07:37:21 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 13 Aug 2009 07:37:21 -0400 Subject: [nycphp-talk] E-commerce site In-Reply-To: <5fdd951b0908122203k34eeef5cqd127d97735b87d38@mail.gmail.com> References: <5fdd951b0908122203k34eeef5cqd127d97735b87d38@mail.gmail.com> Message-ID: <330532b60908130437pd3e5213mce66bbbd4ad4b4c1@mail.gmail.com> Hi Parthasarathy, If all you are looking for is a dedicated commerce site, you will best be served with Magento. Something integrated with a CMS (like Joomla/VirtueMart) only adds value if you have a need for an integrated storefront and website. Would be helpful to know more about what you need, otherwise our replies are just guesses ;-) -- Mitch On Thu, Aug 13, 2009 at 1:03 AM, Partha Sarathy wrote: > Hi All, > I am Parthasarathy. ?I planned to develop e-commerce site using open source > tool. ?Suggest me the best open source tool like Magento, OSCommerce, OSCMax > or Joomla with Virtuemart and so on. Expecting reply. > > -- > T.R.Parthasarathy > > _______________________________________________ > 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 Thu Aug 13 07:44:56 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Thu, 13 Aug 2009 07:44:56 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A83F621.8050008@gmx.net> References: <4A83F621.8050008@gmx.net> Message-ID: <330532b60908130444y1f266b3ehaddeec5458e93ad4@mail.gmail.com> On Thu, Aug 13, 2009 at 7:16 AM, David Krings wrote: > I learned assembler on the Z80 and the editor that we had was really not > much more than a somewhat better text editor. It may depend on the > development kit that is available for the platform. Which brings up an interesting point. I was recently in a shop where all of the senior developers were MIT alumni. They all had these crazy whack-daddy split rounded ergonomic keyboards, and they all worked almost exclusively in emacs. This didn't indicate to me that this was the best environment, but one that required enough effort to get comfortable in to be restricting. Take the jimi hendrix keyboards away, or take emacs away, and these dudes were in a heap o' hurt 'n' pain! I wonder if our strong opinions on environments are more driven by comfort than actual features and whatnot? I got so used to kate and quanta - I lived in KDE for 6 years and never really got over it - and still miss them although I have plenty of really incredible tools in OSX as well... -- Mitch From ajai at bitblit.net Thu Aug 13 08:59:07 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 13 Aug 2009 08:59:07 -0400 (EDT) Subject: [nycphp-talk] Migrate to Cloud In-Reply-To: <003a01ca1bb4$ac9eec40$05dcc4c0$@com> Message-ID: On Wed, 12 Aug 2009, Peter Sawczynec wrote: > I'd like to start migrating to a cloud computing type of work style for > > myself. Essentially use my laptop w/ 500GB Passport HD (USB powered, no > cord) to > > have the work software, but use google Apps for basic document and > email. > > Google seems to have limits on their file sizes and types to store, so > I've looked around > > for more free form cloud storage Are you looking specifically for just storage or cloud apps? -- Aj. From ajai at bitblit.net Thu Aug 13 09:05:42 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 13 Aug 2009 09:05:42 -0400 (EDT) Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A83F621.8050008@gmx.net> Message-ID: On Thu, 13 Aug 2009, David Krings wrote: > I know vi is the holy grail of editors, but I find it cryptic and unintuitive. But that doesn't mean everyone else does. As I keep saying, *I* have no problem with it. > Sure, after learning all the keyboard shortcuts that amount more to a > scripting language you get a lot done, but I find it silly to spend more time > on learning the tool than learning the trade..... unless I am a vi salesman. Just like any other tool, there is a learning curve (a few hours really). An IDE would have a learning curve too. Unlike some people, Im not assuming to speak for everybody. -- Aj. From ajai at bitblit.net Thu Aug 13 09:09:14 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 13 Aug 2009 09:09:14 -0400 (EDT) Subject: [nycphp-talk] Java provides??? In-Reply-To: <4A83F621.8050008@gmx.net> Message-ID: On Thu, 13 Aug 2009, David Krings wrote: > I learned assembler on the Z80 and the editor that we had was really not much > more than a somewhat better text editor. It may depend on the development kit > that is available for the platform. Of course it does. -- Aj. From ajai at bitblit.net Thu Aug 13 09:12:53 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 13 Aug 2009 09:12:53 -0400 (EDT) Subject: [nycphp-talk] Java provides??? In-Reply-To: <330532b60908130444y1f266b3ehaddeec5458e93ad4@mail.gmail.com> Message-ID: On Thu, 13 Aug 2009, Mitch Pirtle wrote: > This didn't indicate to me that this was the best environment, but one > that required enough effort to get comfortable in to be restricting. > Take the jimi hendrix keyboards away, or take emacs away, and these > dudes were in a heap o' hurt 'n' pain! You could say that about any tool though. > I wonder if our strong opinions on environments are more driven by > comfort than actual features and whatnot? As I said earlier, everyone uses what they're comfortable with. There is no 'right' way as long as you're productive and get the job done. -- Aj. From ps at blu-studio.com Thu Aug 13 20:56:38 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 13 Aug 2009 20:56:38 -0400 Subject: [nycphp-talk] Migrate to Cloud In-Reply-To: References: <003a01ca1bb4$ac9eec40$05dcc4c0$@com> Message-ID: <002201ca1c7a$14cf2cb0$3e6d8610$@com> Really just looking for storage at this time. But if anyone can speak to a cloud app setting that is innovative and worth looking at, I'd like to hear. 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 Ajai Khattri Sent: Thursday, August 13, 2009 8:59 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Migrate to Cloud On Wed, 12 Aug 2009, Peter Sawczynec wrote: > I'd like to start migrating to a cloud computing type of work style for > > myself. Essentially use my laptop w/ 500GB Passport HD (USB powered, no > cord) to > > have the work software, but use google Apps for basic document and > email. > > Google seems to have limits on their file sizes and types to store, so > I've looked around > > for more free form cloud storage Are you looking specifically for just storage or cloud apps? -- Aj. _______________________________________________ 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 Thu Aug 13 21:04:33 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 13 Aug 2009 21:04:33 -0400 Subject: [nycphp-talk] Drupal Digging Deep Message-ID: <002301ca1c7b$3017ed30$9047c790$@com> The Drupal site is very informative. But turning to the Drupal user/developer/administrators out there, is there some alternative website(s), book(s) or blog(s) where you have turned and have found invaluable Drupal info over time? Warmest regards, Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From php at lynxtdc.com Thu Aug 13 21:12:33 2009 From: php at lynxtdc.com (Paul McGrane) Date: Thu, 13 Aug 2009 21:12:33 -0400 Subject: [nycphp-talk] Migrate to Cloud In-Reply-To: <002201ca1c7a$14cf2cb0$3e6d8610$@com> References: <003a01ca1bb4$ac9eec40$05dcc4c0$@com> <002201ca1c7a$14cf2cb0$3e6d8610$@com> Message-ID: <84450b6d0908131812m5559dde3k47ff4fbab92f5083@mail.gmail.com> Peter: Take a look at Amazon S3, which is their online storage product (Simple Storage Solution = S3). I am sure it will do what you need and can be easily expanded and integrated with their other services as your needs change. If you are using the Firefox browser, download and install the S3Fox plugin -- does all the heavy lifting for working with S3 as a online drive and allows you to enjoy your new found storage. Paul 2009/8/13 Peter Sawczynec > Really just looking for storage at this time. But if anyone can speak to > a cloud app setting that is innovative and worth looking at, I'd like to > hear. > > 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 Ajai Khattri > Sent: Thursday, August 13, 2009 8:59 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Migrate to Cloud > > On Wed, 12 Aug 2009, Peter Sawczynec wrote: > > > I'd like to start migrating to a cloud computing type of work style > for > > > > myself. Essentially use my laptop w/ 500GB Passport HD (USB powered, > no > > cord) to > > > > have the work software, but use google Apps for basic document and > > email. > > > > Google seems to have limits on their file sizes and types to store, so > > I've looked around > > > > for more free form cloud storage > > > Are you looking specifically for just storage or cloud apps? > > > > -- > Aj. > > _______________________________________________ > 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 -- __________________________ lynxtdc at gmail.com 513.373.4200 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at blu-studio.com Thu Aug 13 21:10:24 2009 From: ps at blu-studio.com (Peter Sawczynec) Date: Thu, 13 Aug 2009 21:10:24 -0400 Subject: [nycphp-talk] PHP Programmer's Revival Brew Message-ID: <003401ca1c7c$0125b010$03711030$@com> Ginger Tea ________________________________ 1 piece fresh ginger root (3" segment) 1 fresh orange 1 tbsp honey 2 cups water 1 mug Small strainer ________________________________ Slice and dice unpeeled ginger root into small chunks. Add ginger to cold water. Bring water to boil. Simmer ginger in water for up to 15 minutes till about half the water is boiled off and water is stained light gold. Strain the remaining one cup liquid into a mug. Cut orange in half. Squeeze one half of orange thru strainer into mug. Add 1 tbsp honey. Drink hot. Will taste good, spicy and sweet. ________________________________ A great pick me up and can knock a cold out too. Warmest regards, Peter Sawczynec Technology Dir. bl?studio 941.893.0396 ps at blu-studio.com www.blu-studio.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From glenn310b at mac.com Thu Aug 13 22:11:34 2009 From: glenn310b at mac.com (Glenn Powell) Date: Thu, 13 Aug 2009 22:11:34 -0400 Subject: [nycphp-talk] Migrate to Cloud In-Reply-To: <002201ca1c7a$14cf2cb0$3e6d8610$@com> References: <003a01ca1bb4$ac9eec40$05dcc4c0$@com> <002201ca1c7a$14cf2cb0$3e6d8610$@com> Message-ID: I've been using Amazon S3 for content storage, and it seems to work ok. For basic file admin work with S3, there is an S3 plugin for Firefox, and Cyberduck. I use it to serve js, images, css etc. for web apps and also for user created content. I'm not sure that I actually "like" depending on S3 to deliver components of the actual web app, but it works. For user created content in a load balanced situation it solves the problem of where to store the user created stuff. Best Regards, Glenn On Aug 13, 2009, at 8:56 PM, Peter Sawczynec wrote: > Really just looking for storage at this time. But if anyone can > speak to > a cloud app setting that is innovative and worth looking at, I'd > like to > hear. > > 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 Ajai Khattri > Sent: Thursday, August 13, 2009 8:59 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Migrate to Cloud > > On Wed, 12 Aug 2009, Peter Sawczynec wrote: > >> I'd like to start migrating to a cloud computing type of work style > for >> >> myself. Essentially use my laptop w/ 500GB Passport HD (USB powered, > no >> cord) to >> >> have the work software, but use google Apps for basic document and >> email. >> >> Google seems to have limits on their file sizes and types to store, >> so >> I've looked around >> >> for more free form cloud storage > > > Are you looking specifically for just storage or cloud apps? > > > > -- > Aj. > > _______________________________________________ > 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 greg at freephile.com Thu Aug 13 22:54:19 2009 From: greg at freephile.com (Greg Rundlett (freephile)) Date: Thu, 13 Aug 2009 22:54:19 -0400 Subject: [nycphp-talk] Drupal Digging Deep In-Reply-To: <002301ca1c7b$3017ed30$9047c790$@com> References: <002301ca1c7b$3017ed30$9047c790$@com> Message-ID: <5e2aaca40908131954n1bcbaa49m63c36142c25a464e@mail.gmail.com> 2009/8/13 Peter Sawczynec : > The Drupal site is very informative. > > > > But turning to the Drupal user/developer/administrators out there, is there > some alternative website(s), book(s) or blog(s) where you have turned and > have found invaluable Drupal info over time? > > I have so many Drupal sites bookmarked, it's hard to say which are the most valuable. check http://www.xmarks.com/topic/drupal http://delicious.com/search?p=drupal groups.drupal.org is one drupaldojo.com is another -- Greg Rundlett Web Developer - Initiative in Innovative Computing http://iic.harvard.edu nbpt 978-225-8302 m. 978-764-4424 -skype/aim/irc/twitter freephile http://profiles.aim.com/freephile From ajai at bitblit.net Fri Aug 14 06:43:23 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Fri, 14 Aug 2009 06:43:23 -0400 (EDT) Subject: [nycphp-talk] Migrate to Cloud In-Reply-To: <002201ca1c7a$14cf2cb0$3e6d8610$@com> Message-ID: On Thu, 13 Aug 2009, Peter Sawczynec wrote: > Really just looking for storage at this time. But if anyone can speak to a cloud app setting that is innovative and worth looking at, I'd like to hear. I recently came across SugarSync (sugarsync.com) who offer 2Gb accounts for free. Allows you to share and sync folders across many computers. They have clients for Mac, Windows but also phones (iPhone, Blackberry, Android - hence my interest). -- Aj. From edwardpotter at gmail.com Fri Aug 14 16:42:34 2009 From: edwardpotter at gmail.com (Edward Potter) Date: Fri, 14 Aug 2009 16:42:34 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: References: <330532b60908130444y1f266b3ehaddeec5458e93ad4@mail.gmail.com> Message-ID: After spending 10 years with Java, I jumped into ObjC on the iPhone/Mac platform. I think it just blows Java away. Really makes programming Fun again. Give it a try. You may be AMAZED at how good ObjC is. On Thu, Aug 13, 2009 at 9:12 AM, Ajai Khattri wrote: > On Thu, 13 Aug 2009, Mitch Pirtle wrote: > > > This didn't indicate to me that this was the best environment, but one > > that required enough effort to get comfortable in to be restricting. > > Take the jimi hendrix keyboards away, or take emacs away, and these > > dudes were in a heap o' hurt 'n' pain! > > You could say that about any tool though. > > > I wonder if our strong opinions on environments are more driven by > > comfort than actual features and whatnot? > > As I said earlier, everyone uses what they're comfortable with. There is > no 'right' way as long as you're productive and get the job done. > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- IM/iChat: ejpusa Links: http://del.icio.us/ejpusa Follow me: http://www.twitter.com/ejpusa Karma: http://www.coderswithconscience.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cbaltatescu at greenvision.ro Fri Aug 14 17:29:44 2009 From: cbaltatescu at greenvision.ro (Cristian Baltatescu) Date: Sat, 15 Aug 2009 00:29:44 +0300 Subject: [nycphp-talk] Java provides??? In-Reply-To: References: <330532b60908130444y1f266b3ehaddeec5458e93ad4@mail.gmail.com> Message-ID: <422973430908141429o51fe6729o55cfd54db572533f@mail.gmail.com> I don't understand, are you referring to the language itself (cos i find it a bit weird) or to the nice things you can do it, using the whole platform actually?I mean its very rewarding to create something that responds to touch and other stuff on a device like the iphone, but i'm not sure how much of that comes from objC as a language. On Fri, Aug 14, 2009 at 11:42 PM, Edward Potter wrote: > > After spending 10 years with Java, I jumped into ObjC on the iPhone/Mac > platform. I think it just blows Java away. Really makes programming Fun > again. Give it a try. You may be AMAZED at how good ObjC is. > > > On Thu, Aug 13, 2009 at 9:12 AM, Ajai Khattri wrote: > >> On Thu, 13 Aug 2009, Mitch Pirtle wrote: >> >> > This didn't indicate to me that this was the best environment, but one >> > that required enough effort to get comfortable in to be restricting. >> > Take the jimi hendrix keyboards away, or take emacs away, and these >> > dudes were in a heap o' hurt 'n' pain! >> >> You could say that about any tool though. >> >> > I wonder if our strong opinions on environments are more driven by >> > comfort than actual features and whatnot? >> >> As I said earlier, everyone uses what they're comfortable with. There is >> no 'right' way as long as you're productive and get the job done. >> >> >> >> -- >> Aj. >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show_participation.php >> > > > > -- > IM/iChat: ejpusa > Links: http://del.icio.us/ejpusa > Follow me: http://www.twitter.com/ejpusa > Karma: http://www.coderswithconscience.com > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Cristian -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Sat Aug 15 05:28:14 2009 From: leam at reuel.net (Leam Hall) Date: Sat, 15 Aug 2009 05:28:14 -0400 Subject: [nycphp-talk] What does Java provide, redux Message-ID: <4A867FAE.3080002@reuel.net> Thanks folks! So there are some things like concurrency and XSLT 2.0 that Java provides that makes it a contender in the system space. I'm not really programmer enough to get that part but I'll accept your thoughts. :) Of course, now part of me wonders if Python could cover where PHP doesn't and we could keep Java contained in the Uni classroom. That might help computer load levels a good bit... Again, thanks! Leam From ajai at bitblit.net Sat Aug 15 10:46:27 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sat, 15 Aug 2009 10:46:27 -0400 (EDT) Subject: [nycphp-talk] Java provides??? In-Reply-To: Message-ID: On Fri, 14 Aug 2009, Edward Potter wrote: > After spending 10 years with Java, I jumped into ObjC on the iPhone/Mac > platform. I think it just blows Java away. Really makes programming Fun > again. Give it a try. You may be AMAZED at how good ObjC is. I like to call it Obfuscated-C :-) Actually as mobile platforms go, iPhone has the steepest learning curve, but the mobile space is very interesting and has brought some fun back into programming (well, at least for me). -- Aj. From ajai at bitblit.net Sat Aug 15 10:51:40 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sat, 15 Aug 2009 10:51:40 -0400 (EDT) Subject: [nycphp-talk] What does Java provide, redux In-Reply-To: <4A867FAE.3080002@reuel.net> Message-ID: On Sat, 15 Aug 2009, Leam Hall wrote: > Of course, now part of me wonders if Python could cover where PHP > doesn't and we could keep Java contained in the Uni classroom. That > might help computer load levels a good bit... Why not Ruby? -- Aj. From ben at projectskyline.com Sat Aug 15 21:14:33 2009 From: ben at projectskyline.com (Ben Sgro) Date: Sat, 15 Aug 2009 21:14:33 -0400 Subject: [nycphp-talk] Java provides??? In-Reply-To: References: Message-ID: <4A875D79.5050000@projectskyline.com> Hey Edward, Right on man - I love coding w/obj-c/iphone/xcode. The workflow within XCode is awesome - I find it really productive and I love the integration w/gdb/IB. Obj-c itself has some cool features, like all the NSString convenience methods, @synthesized getters/setters, along with all the neat features of the iphone (gestures, accelerometer, etc). I just got into it about 5 months ago, but I've been compelled to create some apps, a few of which are in the appstore. Search "ben sgro" to check them out! Said it best: Really makes programming Fun again. Give it a try. You may be AMAZED at how good ObjC is. and has brought some fun back into programming (well, at least for me). - Ben Ajai Khattri wrote: > On Fri, 14 Aug 2009, Edward Potter wrote: > > >> After spending 10 years with Java, I jumped into ObjC on the iPhone/Mac >> platform. I think it just blows Java away. Really makes programming Fun >> again. Give it a try. You may be AMAZED at how good ObjC is. >> > > I like to call it Obfuscated-C :-) > > Actually as mobile platforms go, iPhone has the steepest learning curve, > but the mobile space is very interesting and has brought some fun back > into programming (well, at least for me). > > > > From smanes at magpie.com Sat Aug 15 22:22:16 2009 From: smanes at magpie.com (Steve Manes) Date: Sat, 15 Aug 2009 22:22:16 -0400 Subject: [nycphp-talk] Drupal Digging Deep In-Reply-To: <002301ca1c7b$3017ed30$9047c790$@com> References: <002301ca1c7b$3017ed30$9047c790$@com> Message-ID: <4A876D58.8040903@magpie.com> Peter Sawczynec wrote: > The Drupal site is very informative. > > But turning to the Drupal user/developer/administrators out there, is > there some alternative website(s), book(s) or blog(s) where you have > turned and have found invaluable Drupal info over time? For me, Pro Drupal Development was everything I needed to start building modules. From leam at reuel.net Sat Aug 15 22:28:05 2009 From: leam at reuel.net (Leam Hall) Date: Sat, 15 Aug 2009 22:28:05 -0400 Subject: [nycphp-talk] What does Java provide, redux In-Reply-To: References: Message-ID: <4A876EB5.9070606@reuel.net> Ajai Khattri wrote: > On Sat, 15 Aug 2009, Leam Hall wrote: > >> Of course, now part of me wonders if Python could cover where PHP >> doesn't and we could keep Java contained in the Uni classroom. That >> might help computer load levels a good bit... > > Why not Ruby? Nothing I've read in Ruby made sense. Python makes sense, PHP makes sense. Ruby has come to me like an artist's side of the brain and I'm just not artistic. Of course, programming can be art so others probably "get it" better. Leam From jmcgraw1 at gmail.com Sun Aug 16 18:21:10 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Sun, 16 Aug 2009 18:21:10 -0400 Subject: [nycphp-talk] PHP Programmer's Revival Brew In-Reply-To: <003401ca1c7c$0125b010$03711030$@com> References: <003401ca1c7c$0125b010$03711030$@com> Message-ID: I prefer two ice cold redbulls... but to each his own. 2009/8/13 Peter Sawczynec : > Ginger Tea > > ________________________________ > > > > 1 piece fresh ginger root (3" segment) > > 1 fresh orange > > 1 tbsp honey > > 2 cups water > > > > 1 mug > > Small strainer > > ________________________________ > > > > Slice and dice unpeeled ginger root into small chunks. > > > > Add ginger to cold water. > > > > Bring water to boil. > > > > Simmer ginger in water for up to 15 minutes till about half the water > > is boiled off and water is stained light gold. > > > > Strain the remaining one cup liquid into a mug. > > > > Cut orange in half. Squeeze one half of orange thru strainer into mug. > > > > Add 1 tbsp honey. > > > > Drink hot. Will taste good, spicy and sweet. > > ?________________________________ > > > > A great pick me up and can knock a cold out too. > > > > > > Warmest regards, > > > > Peter Sawczynec > > Technology Dir. > > bl?studio > > 941.893.0396 > > ps at blu-studio.com > > www.blu-studio.com > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From justin at justinhileman.info Sun Aug 16 19:42:29 2009 From: justin at justinhileman.info (Justin Hileman) Date: Sun, 16 Aug 2009 19:42:29 -0400 Subject: [nycphp-talk] PHP Programmer's Revival Brew In-Reply-To: References: <003401ca1c7c$0125b010$03711030$@com> Message-ID: <4A889965.2010402@justinhileman.info> Jake McGraw wrote: > I prefer two ice cold redbulls... but to each his own. Mountain Dew Throwback, back when I could get it :) -- justin http://justinhileman.com From dan.horning at planetnoc.com Sun Aug 16 22:43:31 2009 From: dan.horning at planetnoc.com (Daniel Horning) Date: Sun, 16 Aug 2009 22:43:31 -0400 Subject: [nycphp-talk] PHP Programmer's Revival Brew In-Reply-To: <4A889965.2010402@justinhileman.info> References: <003401ca1c7c$0125b010$03711030$@com> <4A889965.2010402@justinhileman.info> Message-ID: <000001ca1ee4$82e51b30$88af5190$@horning@planetnoc.com> > Jake McGraw wrote: > > I prefer two ice cold redbulls... but to each his own. > > Mountain Dew Throwback, back when I could get it :) > > justin Tea, Hot, with 6 packets of sugar minimum -- Dan Horning From mitch.pirtle at gmail.com Mon Aug 17 09:09:46 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Mon, 17 Aug 2009 09:09:46 -0400 Subject: [nycphp-talk] PHP Programmer's Revival Brew In-Reply-To: <5199824136155074204@unknownmsgid> References: <003401ca1c7c$0125b010$03711030$@com> <4A889965.2010402@justinhileman.info> <5199824136155074204@unknownmsgid> Message-ID: <330532b60908170609x691a6c20m4fed67be018454b6@mail.gmail.com> Those little 4-packs of Murphy's are just about the right size to last through a clean install and fresh macports setup. -- Mitch On Sun, Aug 16, 2009 at 10:43 PM, Daniel Horning wrote: >> Jake McGraw wrote: >> > I prefer two ice cold redbulls... but to each his own. >> >> Mountain Dew Throwback, back when I could get it :) >> >> justin > > Tea, Hot, with 6 packets of sugar minimum > > -- > Dan Horning > > _______________________________________________ > 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 Mon Aug 17 10:34:39 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Mon, 17 Aug 2009 10:34:39 -0400 Subject: [nycphp-talk] What does Java provide, redux In-Reply-To: References: Message-ID: <4A896A7F.3060009@devonianfarm.com> Ajai Khattri wrote: > On Sat, 15 Aug 2009, Leam Hall wrote: > > >> Of course, now part of me wonders if Python could cover where PHP >> doesn't and we could keep Java contained in the Uni classroom. That >> might help computer load levels a good bit... >> > > Why not Ruby? > > Looking at post-PHP alternatives, I gave up on both Python and Ruby pretty quickly. Although Python and Ruby are more advanced languages in some ways, they're not "better enough" than PHP to be worth the cost of switching. There's also the issue that neither one has developed a completely satisfactory server runtime, although Ruby has come close. Python, Ruby, PHP and all other dynamic languages are going to be handicapped when it comes to concurrent programming. Although languages of that type ~can~ support threads with primitives much like Java, they invariably have data structures that require locking (symbol tables) that reduce the amount of concurrency they can exploit. Open source languages also tend to depend on legacy libraries that aren't thread safe: the "100% Pure Java" xenophobia has helped Java create one of the very few runtimes that supports concurrency on different platforms. From jbaltz at altzman.com Mon Aug 17 11:02:16 2009 From: jbaltz at altzman.com (Jerry B. Altzman) Date: Mon, 17 Aug 2009 11:02:16 -0400 Subject: [nycphp-talk] What does Java provide, redux In-Reply-To: <4A896A7F.3060009@devonianfarm.com> References: <4A896A7F.3060009@devonianfarm.com> Message-ID: <4A8970F8.4060105@altzman.com> on 8/17/2009 10:34 AM Paul A Houle said the following: > Ajai Khattri wrote: >> Why not Ruby? > Looking at post-PHP alternatives, I gave up on both Python and Ruby > pretty quickly. Although Python and Ruby are more advanced languages in > some ways, they're not "better enough" than PHP to be worth the cost of > switching. There's also the issue that neither one has developed a Until you can amortize away that period of negative productivity while you're switching languages, it's almost always better to stick with what you know, unless there's a really really compelling other reason (like: what you want to do can be done in 10% of the time in ) > completely satisfactory server runtime, although Ruby has come close. I've found twisted to be really nice for Python. > Python, Ruby, PHP and all other dynamic languages are going to be > handicapped when it comes to concurrent programming. Although languages > of that type ~can~ support threads with primitives much like Java, they > invariably have data structures that require locking (symbol tables) > that reduce the amount of concurrency they can exploit. Open source > languages also tend to depend on legacy libraries that aren't thread > safe: the "100% Pure Java" xenophobia has helped Java create one of the > very few runtimes that supports concurrency on different platforms. Erlang? //jbaltz -- jerry b. altzman jbaltz at altzman.com www.jbaltz.com thank you for contributing to the heat death of the universe. From paul at devonianfarm.com Mon Aug 17 11:43:25 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Mon, 17 Aug 2009 11:43:25 -0400 Subject: [nycphp-talk] What does Java provide, redux In-Reply-To: <4A8970F8.4060105@altzman.com> References: <4A896A7F.3060009@devonianfarm.com> <4A8970F8.4060105@altzman.com> Message-ID: <4A897A9D.8040106@devonianfarm.com> Jerry B. Altzman wrote: > > Until you can amortize away that period of negative productivity while > you're switching languages, it's almost always better to stick with > what you know, unless there's a really really compelling other reason > (like: what you want to do can be done in 10% of the time in language>) > > It's not so much the learning that I'm concerned about, it's the rewriting of the problem-specific toolkits that I use. > > Erlang? Yes, Erlang is one of the few. From tmpvar at gmail.com Mon Aug 17 20:14:53 2009 From: tmpvar at gmail.com (Elijah Insua) Date: Mon, 17 Aug 2009 20:14:53 -0400 Subject: [nycphp-talk] PHP Programmer's Revival Brew In-Reply-To: <330532b60908170609x691a6c20m4fed67be018454b6@mail.gmail.com> References: <003401ca1c7c$0125b010$03711030$@com> <4A889965.2010402@justinhileman.info> <5199824136155074204@unknownmsgid> <330532b60908170609x691a6c20m4fed67be018454b6@mail.gmail.com> Message-ID: <2b4feca10908171714i1005e3f1sc38400e4d273052b@mail.gmail.com> Jager Bombs! On Mon, Aug 17, 2009 at 9:09 AM, Mitch Pirtle wrote: > Those little 4-packs of Murphy's are just about the right size to last > through a clean install and fresh macports setup. > > -- Mitch > > On Sun, Aug 16, 2009 at 10:43 PM, Daniel > Horning wrote: > >> Jake McGraw wrote: > >> > I prefer two ice cold redbulls... but to each his own. > >> > >> Mountain Dew Throwback, back when I could get it :) > >> > >> justin > > > > Tea, Hot, with 6 packets of sugar minimum > > > > -- > > Dan Horning > > > > _______________________________________________ > > 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 dsteplight at gmail.com Mon Aug 17 22:44:29 2009 From: dsteplight at gmail.com (Darryle Steplight) Date: Mon, 17 Aug 2009 22:44:29 -0400 Subject: [nycphp-talk] PHP Programmer's Revival Brew In-Reply-To: <2b4feca10908171714i1005e3f1sc38400e4d273052b@mail.gmail.com> References: <003401ca1c7c$0125b010$03711030$@com> <4A889965.2010402@justinhileman.info> <5199824136155074204@unknownmsgid> <330532b60908170609x691a6c20m4fed67be018454b6@mail.gmail.com> <2b4feca10908171714i1005e3f1sc38400e4d273052b@mail.gmail.com> Message-ID: <47f4c4570908171944r6e2b1e06s683ec403e9623c51@mail.gmail.com> I'm old school and an 80's baby. Whatever happen to an old fashion large Dominoes Pizza and a 3 liter of Pepsi? On Mon, Aug 17, 2009 at 8:14 PM, Elijah Insua wrote: > Jager Bombs! > > On Mon, Aug 17, 2009 at 9:09 AM, Mitch Pirtle > wrote: >> >> Those little 4-packs of Murphy's are just about the right size to last >> through a clean install and fresh macports setup. >> >> -- Mitch >> >> On Sun, Aug 16, 2009 at 10:43 PM, Daniel >> Horning wrote: >> >> Jake McGraw wrote: >> >> > I prefer two ice cold redbulls... but to each his own. >> >> >> >> Mountain Dew Throwback, back when I could get it :) >> >> >> >> justin >> > >> > Tea, Hot, with 6 packets of sugar minimum >> > >> > -- >> > Dan Horning >> > >> > _______________________________________________ >> > 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 > -- 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 mmwaldman at nyc.rr.com Tue Aug 18 22:58:39 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Tue, 18 Aug 2009 22:58:39 -0400 Subject: [nycphp-talk] HTML Javascript Php Arrays Message-ID: <20090819030000254.FVQH19867@hrndva-omta02.mail.rr.com> I'm trying to dynamically create an array in javascript to pass to php. This works in FF, but not IE 7. Does anyone know how to make this work in IE? var inp = document.createElement("input"); inp.type = "text"; inp.name = "city[]"; inp.id = "city0"; inp.value = "Houston"; document.getElementById('theDiv').appendChild(inp); document.getElementById("city0").length -> 1 document.getElementsByName("lcity[]").length -> 0 Michele -------------- next part -------------- An HTML attachment was scrubbed... URL: From mangesh at ascellent.co.in Wed Aug 19 01:00:43 2009 From: mangesh at ascellent.co.in (Mangesh Sathe) Date: Wed, 19 Aug 2009 10:30:43 +0530 Subject: [nycphp-talk] small problem in ajax Message-ID: hello everyone, This is Mangesh Sathe. I am facin' small problem in ajax. I have created one form which contains entries like his/her name,address,country, state ,bank name(dropdown list) , birth date etc... when i submit this form all the above data goes to databse correctly ... now if his/her bank name is not in the dropdown list , then he enters his bank name in textbox & clicks on first button so insted of submitting entire forn ,i want to insert only bank name in database using ajax. ( i am sending bank name to .js file & then call .php file Buttons in the form, first one is for adding bank name in database,if it does'nt exist in Dropdown list (Drop downlist---Textbox----Button1) second one is to submit entire form. Reply plz -- Thanks & Regards, Mangesh Sathe -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Wed Aug 19 01:17:55 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 19 Aug 2009 01:17:55 -0400 (EDT) Subject: [nycphp-talk] HTML Javascript Php Arrays In-Reply-To: <20090819030000254.FVQH19867@hrndva-omta02.mail.rr.com> Message-ID: On Tue, 18 Aug 2009, Michele Waldman wrote: > I'm trying to dynamically create an array in javascript to pass to php. > > This works in FF, but not IE 7. Does anyone know how to make this work in > IE? You probably should look at using Prototype or JQuery to do this kind of stuff since those frameworks isolate you from having to deal with differences across browers. -- Aj. From cbaltatescu at greenvision.ro Wed Aug 19 02:28:31 2009 From: cbaltatescu at greenvision.ro (Cristian Baltatescu) Date: Wed, 19 Aug 2009 09:28:31 +0300 Subject: [nycphp-talk] HTML Javascript Php Arrays In-Reply-To: <20090819030000254.FVQH19867@hrndva-omta02.mail.rr.com> References: <20090819030000254.FVQH19867@hrndva-omta02.mail.rr.com> Message-ID: <422973430908182328y68293b86vba327982185afaac@mail.gmail.com> On Wed, Aug 19, 2009 at 5:58 AM, Michele Waldman wrote: > I?m trying to dynamically create an array in javascript to pass to php. > > > > This works in FF, but not IE 7. Does anyone know how to make this work in > IE? > > > > var inp = document.createElement("input"); > > inp.type = "text"; > > inp.name = "city[]"; > > inp.id = "city0?; > > inp.value = ?Houston?; > > document.getElementById('theDiv?).appendChild(inp); > > > > document.getElementById("city0?).length -> 1 > > document.getElementsByName("lcity[]").length -> 0 > > > > Michele > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > Shouldn't document.getElementById("city0?).length be document.getElementById("city0?).value.length ? Also, you should look into creating a json string, send it to php and use json_decode on the php side. If what you're looking for is sending arrays to php. But I'm not sure you're thinking of the same thing looking at your example. -- Numai bine, Cristian -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Wed Aug 19 07:58:47 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 19 Aug 2009 07:58:47 -0400 Subject: [nycphp-talk] HTML Javascript Php Arrays In-Reply-To: <422973430908182328y68293b86vba327982185afaac@mail.gmail.com> Message-ID: <20090819120008881.GJPF7912@hrndva-omta03.mail.rr.com> Yeah, there's no document.getElementById("city0").length. I'm not even using that particular statement. I was just trying to iterate that document.getElementById("city0") was definited. Specifically that the id is being used to identify the element but name is not. Michele _____ From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Cristian Baltatescu Sent: Wednesday, August 19, 2009 2:29 AM To: NYPHP Talk Subject: Re: [nycphp-talk] HTML Javascript Php Arrays On Wed, Aug 19, 2009 at 5:58 AM, Michele Waldman wrote: I'm trying to dynamically create an array in javascript to pass to php. This works in FF, but not IE 7. Does anyone know how to make this work in IE? var inp = document.createElement("input"); inp.type = "text"; inp.name = "city[]"; inp.id = "city0"; inp.value = "Houston"; document.getElementById('theDiv').appendChild(inp); document.getElementById("city0").length -> 1 document.getElementsByName("lcity[]").length -> 0 Michele _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php Shouldn't document.getElementById("city0").length be document.getElementById("city0").value.length ? Also, you should look into creating a json string, send it to php and use json_decode on the php side. If what you're looking for is sending arrays to php. But I'm not sure you're thinking of the same thing looking at your example. -- Numai bine, Cristian -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmwaldman at nyc.rr.com Wed Aug 19 08:13:36 2009 From: mmwaldman at nyc.rr.com (Michele Waldman) Date: Wed, 19 Aug 2009 08:13:36 -0400 Subject: [nycphp-talk] HTML Javascript Php Arrays In-Reply-To: Message-ID: <20090819121456243.ZPXT22490@hrndva-omta01.mail.rr.com> I didn't want to have to do it but this works: document.getElementById('theDiv').innerHTML = ""; This is my typical work around for IE. Michele > -----Original Message----- > From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > On Behalf Of Ajai Khattri > Sent: Wednesday, August 19, 2009 1:18 AM > To: NYPHP Talk > Cc: javascript-7 at meetup.com > Subject: Re: [nycphp-talk] HTML Javascript Php Arrays > > On Tue, 18 Aug 2009, Michele Waldman wrote: > > > I'm trying to dynamically create an array in javascript to pass to php. > > > > This works in FF, but not IE 7. Does anyone know how to make this work > in > > IE? > > You probably should look at using Prototype or JQuery to do this kind of > stuff since those frameworks isolate you from having to deal with > differences across browers. > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From chuck.reeves at gmail.com Wed Aug 19 09:28:15 2009 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Wed, 19 Aug 2009 09:28:15 -0400 Subject: [nycphp-talk] small problem in ajax In-Reply-To: References: Message-ID: I would say submit the entire form and have the text box take precedence over the drop down. Thank You Chuck Reeves Email: chuck.reeves at gmail.com On Wed, Aug 19, 2009 at 1:00 AM, Mangesh Sathe wrote: > hello everyone, > > This is Mangesh Sathe. > > I am facin' small problem in ajax. > > I have created one form which contains entries like his/her > name,address,country, state ,bank name(dropdown list) , birth date > etc... > when i submit this form all the above data goes to databse correctly ... > > now if his/her bank name is not in the dropdown list , then he enters his > bank name in textbox & clicks on first button > so insted of submitting entire forn ,i want to insert only bank name in > database using ajax. > ( i am sending bank name to .js file & then call .php file > > Buttons in the form, > first one is for adding bank name in database,if it does'nt exist in > Dropdown list > (Drop downlist---Textbox----Button1) > second one is to submit entire form. > > Reply plz > -- > Thanks & Regards, > Mangesh Sathe > > _______________________________________________ > 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 brenttech at gmail.com Wed Aug 19 09:48:02 2009 From: brenttech at gmail.com (Brent Baisley) Date: Wed, 19 Aug 2009 09:48:02 -0400 Subject: [nycphp-talk] small problem in ajax In-Reply-To: References: Message-ID: <5d515c620908190648u73ac728dwd8a006b42797aecc@mail.gmail.com> On Wed, Aug 19, 2009 at 1:00 AM, Mangesh Sathe wrote: > hello everyone, > > ?This is Mangesh Sathe. > > ?? I?am facin'? small problem in ajax. > > I?have created one form which contains entries like his/her > ?? name,address,country, state ,bank name(dropdown list) ,?birth date etc... > when i submit this form all the above data goes to databse correctly ... > > ?now if his/her bank name is not in the dropdown list , then he enters his > bank name in textbox & clicks on first button > ? so insted of submitting entire forn ,i want to?insert only bank name in > database using ajax. > ?( i am sending bank name to .js file & then call .php file > > Buttons in the?form, > ?? ?first one is for adding bank name in database,if it does'nt exist in > Dropdown list > ??????? (Drop downlist---Textbox----Button1) > ??? second one is?to submit entire form. > > Reply plz You should keep it as a single submission for simplicity for the user. I would have an "Other" as the last item in the drop down list, which would reveal a field to enter a bank name in. Select a bank name would hide the field. Then on the server side you check if the "Other" bank option was selected, then enter the "Other" bank name in your database. It keeps it to a single form submission with a single button. From yitzchak.schaffer at gmx.com Thu Aug 20 09:43:26 2009 From: yitzchak.schaffer at gmx.com (Yitzchak Schaffer) Date: Thu, 20 Aug 2009 09:43:26 -0400 Subject: [nycphp-talk] Working with designers Message-ID: <4A8D52FE.6070200@gmx.com> Hello all, I discovered a great resource a few months back: http://www.webdesignerdepot.com/ One post in particular, http://bit.ly/designers-developers , got me thinking about workign with designers. Since we have no design staff in our shop per se (the technical office of an academic library), my PHP sidekick and I put together whatever designy elements we need for our sites. After reading this article, I'm left wondering: what are the basics of working with designers? I wasn't even familiar with the term "comp" that's being used in the post and comments. Where can one learn the fundamental assumed communication patterns, role & workflow expectations, etc. that go along with this relationship? What is a developer meant to do after being handed a PSD? Many TIA! -- Yitzchak Schaffer Systems Manager Touro College Libraries 33 West 23rd Street New York, NY 10010 Tel (212) 463-0400 x5230 Fax (212) 627-3197 Email yitzchak.schaffer at tourolib.org From ka at kacomputerconsulting.com Thu Aug 20 10:07:48 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Thu, 20 Aug 2009 07:07:48 -0700 Subject: [nycphp-talk] Working with designers Message-ID: <1250777268.26128@coral.he.net> Hi, It seems to me that in the post you refer to below, the "designers" are confused about what a "developer" is. A "developer" does not translate a PDF or comp or whatever they are calling it these days into an HTML page...that is a job for the production people in the Production department. By the time this thing gets anywhere near a developer, it should already be laid out in HTML adequate to the designer's perspective, i.e. be a dead UI that needs to be brought to life by the magic of code. OK most of the time the form code is rather sparse and needs to be enhanced, but that's fine. I'd avoid like the plague any "designers" who think developers have time to waste doing Production layouts....what's next, I don't suppose they'd also like us to pick up their drycleaning? :) Kristina > Hello all, > > I discovered a great resource a few months back: > http://www.webdesignerdepot.com/ > > One post in particular, http://bit.ly/designers-developers , got me > thinking about workign with designers. Since we have no design staff in > our shop per se (the technical office of an academic library), my PHP > sidekick and I put together whatever designy elements we need for our sites. > > After reading this article, I'm left wondering: what are the basics of > working with designers? I wasn't even familiar with the term "comp" > that's being used in the post and comments. Where can one learn the > fundamental assumed communication patterns, role & workflow > expectations, etc. that go along with this relationship? What is a > developer meant to do after being handed a PSD? > > Many TIA! > > -- > Yitzchak Schaffer > Systems Manager > Touro College Libraries > 33 West 23rd Street > New York, NY 10010 > Tel (212) 463-0400 x5230 > Fax (212) 627-3197 > Email yitzchak.schaffer at tourolib.org > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From ka at kacomputerconsulting.com Thu Aug 20 10:07:48 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Thu, 20 Aug 2009 07:07:48 -0700 Subject: [nycphp-talk] Working with designers Message-ID: <1250777268.26128@coral.he.net> Hi, It seems to me that in the post you refer to below, the "designers" are confused about what a "developer" is. A "developer" does not translate a PDF or comp or whatever they are calling it these days into an HTML page...that is a job for the production people in the Production department. By the time this thing gets anywhere near a developer, it should already be laid out in HTML adequate to the designer's perspective, i.e. be a dead UI that needs to be brought to life by the magic of code. OK most of the time the form code is rather sparse and needs to be enhanced, but that's fine. I'd avoid like the plague any "designers" who think developers have time to waste doing Production layouts....what's next, I don't suppose they'd also like us to pick up their drycleaning? :) Kristina > Hello all, > > I discovered a great resource a few months back: > http://www.webdesignerdepot.com/ > > One post in particular, http://bit.ly/designers-developers , got me > thinking about workign with designers. Since we have no design staff in > our shop per se (the technical office of an academic library), my PHP > sidekick and I put together whatever designy elements we need for our sites. > > After reading this article, I'm left wondering: what are the basics of > working with designers? I wasn't even familiar with the term "comp" > that's being used in the post and comments. Where can one learn the > fundamental assumed communication patterns, role & workflow > expectations, etc. that go along with this relationship? What is a > developer meant to do after being handed a PSD? > > Many TIA! > > -- > Yitzchak Schaffer > Systems Manager > Touro College Libraries > 33 West 23rd Street > New York, NY 10010 > Tel (212) 463-0400 x5230 > Fax (212) 627-3197 > Email yitzchak.schaffer at tourolib.org > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From yitzchak.schaffer at gmx.com Thu Aug 20 10:11:25 2009 From: yitzchak.schaffer at gmx.com (Yitzchak Schaffer) Date: Thu, 20 Aug 2009 10:11:25 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <1250777268.26128@coral.he.net> References: <1250777268.26128@coral.he.net> Message-ID: <4A8D598D.60308@gmx.com> Kristina D. H. Anderson wrote: > It seems to me that in the post you refer to below, the "designers" are > confused about what a "developer" is. A "developer" does not translate > a PDF or comp or whatever they are calling it these days into an HTML > page...that is a job for the production people in the Production > department. OK, that makes more sense. -- Yitzchak Schaffer Systems Manager Touro College Libraries 33 West 23rd Street New York, NY 10010 Tel (212) 463-0400 x5230 Fax (212) 627-3197 Email yitzchak.schaffer at tourolib.org From gatzby3jr at gmail.com Thu Aug 20 10:21:25 2009 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 20 Aug 2009 10:21:25 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <1250777268.26128@coral.he.net> References: <1250777268.26128@coral.he.net> Message-ID: <29da5d150908200721o72b0fdbavea04b75efbea357@mail.gmail.com> That really depends on how your environment is set up. If there is no "Production department" then that very well may be the job of the developer. I work with one other 'developer' and one 'designer' on all of our projects. The designer hands us a PSD, and one of us is left to translate it in to html/css/javascript. Having separate departments / employees who handle things like PSD -> HTML translations is great if you have it, but not everyone does. On Thu, Aug 20, 2009 at 10:07 AM, Kristina D. H. Anderson < ka at kacomputerconsulting.com> wrote: > Hi, > > It seems to me that in the post you refer to below, the "designers" are > confused about what a "developer" is. A "developer" does not translate > a PDF or comp or whatever they are calling it these days into an HTML > page...that is a job for the production people in the Production > department. > > By the time this thing gets anywhere near a developer, it should > already be laid out in HTML adequate to the designer's perspective, > i.e. be a dead UI that needs to be brought to life by the magic of > code. OK most of the time the form code is rather sparse and needs to > be enhanced, but that's fine. > > I'd avoid like the plague any "designers" who think developers have > time to waste doing Production layouts....what's next, I don't suppose > they'd also like us to pick up their drycleaning? :) > > Kristina > > > Hello all, > > > > I discovered a great resource a few months back: > > http://www.webdesignerdepot.com/ > > > > One post in particular, http://bit.ly/designers-developers , got me > > thinking about workign with designers. Since we have no design staff > in > > our shop per se (the technical office of an academic library), my PHP > > sidekick and I put together whatever designy elements we need for our > sites. > > > > After reading this article, I'm left wondering: what are the basics > of > > working with designers? I wasn't even familiar with the term "comp" > > that's being used in the post and comments. Where can one learn the > > fundamental assumed communication patterns, role & workflow > > expectations, etc. that go along with this relationship? What is a > > developer meant to do after being handed a PSD? > > > > Many TIA! > > > > -- > > Yitzchak Schaffer > > Systems Manager > > Touro College Libraries > > 33 West 23rd Street > > New York, NY 10010 > > Tel (212) 463-0400 x5230 > > Fax (212) 627-3197 > > Email yitzchak.schaffer at tourolib.org > > _______________________________________________ > > 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 > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From ka at kacomputerconsulting.com Thu Aug 20 10:34:08 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Thu, 20 Aug 2009 07:34:08 -0700 Subject: [nycphp-talk] Working with designers Message-ID: <1250778848.2384@coral.he.net> I agree and understand, but also think that it benefits companies to separate out these duties. A programmer is usually a very substandard graphic designer, and vice versa. It's very fortunate that your company had the luck to find two programmers who not only are competent doing Production work but don't mind doing it...they may find their luck changing if the job market picks up methinks :) Kristina > > That really depends on how your environment is set up. If there is no > "Production department" then that very well may be the job of the > developer. I work with one other 'developer' and one 'designer' on all of > our projects. The designer hands us a PSD, and one of us is left to > translate it in to html/css/javascript. > > Having separate departments / employees who handle things like PSD -> HTML > translations is great if you have it, but not everyone does. > > On Thu, Aug 20, 2009 at 10:07 AM, Kristina D. H. Anderson < > ka at kacomputerconsulting.com> wrote: > > > Hi, > > > > It seems to me that in the post you refer to below, the "designers" are > > confused about what a "developer" is. A "developer" does not translate > > a PDF or comp or whatever they are calling it these days into an HTML > > page...that is a job for the production people in the Production > > department. > > > > By the time this thing gets anywhere near a developer, it should > > already be laid out in HTML adequate to the designer's perspective, > > i.e. be a dead UI that needs to be brought to life by the magic of > > code. OK most of the time the form code is rather sparse and needs to > > be enhanced, but that's fine. > > > > I'd avoid like the plague any "designers" who think developers have > > time to waste doing Production layouts....what's next, I don't suppose > > they'd also like us to pick up their drycleaning? :) > > > > Kristina > > > > > Hello all, > > > > > > I discovered a great resource a few months back: > > > http://www.webdesignerdepot.com/ > > > > > > One post in particular, http://bit.ly/designers-developers , got me > > > thinking about workign with designers. Since we have no design staff > > in > > > our shop per se (the technical office of an academic library), my PHP > > > sidekick and I put together whatever designy elements we need for our > > sites. > > > > > > After reading this article, I'm left wondering: what are the basics > > of > > > working with designers? I wasn't even familiar with the term "comp" > > > that's being used in the post and comments. Where can one learn the > > > fundamental assumed communication patterns, role & workflow > > > expectations, etc. that go along with this relationship? What is a > > > developer meant to do after being handed a PSD? > > > > > > Many TIA! > > > > > > -- > > > Yitzchak Schaffer > > > Systems Manager > > > Touro College Libraries > > > 33 West 23rd Street > > > New York, NY 10010 > > > Tel (212) 463-0400 x5230 > > > Fax (212) 627-3197 > > > Email yitzchak.schaffer at tourolib.org > > > _______________________________________________ > > > 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 > > > > > > -- > Brian O'Connor > > From paul at devonianfarm.com Thu Aug 20 10:43:16 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Thu, 20 Aug 2009 10:43:16 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <4A8D52FE.6070200@gmx.com> References: <4A8D52FE.6070200@gmx.com> Message-ID: <4A8D6104.1000708@devonianfarm.com> Yitzchak Schaffer wrote: > Hello all, > > I discovered a great resource a few months back: > http://www.webdesignerdepot.com/ > > One post in particular, http://bit.ly/designers-developers , got me > thinking about workign with designers. Since we have no design staff > in our shop per se (the technical office of an academic library), my > PHP sidekick and I put together whatever designy elements we need for > our sites. > > After reading this article, I'm left wondering: what are the basics of > working with designers? I wasn't even familiar with the term "comp" > that's being used in the post and comments. Where can one learn the > fundamental assumed communication patterns, role & workflow > expectations, etc. that go along with this relationship? What is a > developer meant to do after being handed a PSD? > > Many TIA! > A "designer" can mean very different things. Some "designers" are very good at drawing and painting. My wife, for instance, occasionally does corporate identity work for smaller businesses that want a really original logo. She prototypes with pencil and paper and only converts to a digital vector format late in the process. Other "designers" are good with tools like photoshop and illustrator. Some of them can draw and some can't. An eye for composition, colors, and choosing fonts can get you a long way. Most "designers" aren't that creative. That's not a bad thing, because copying elements of other people's work helps create a 'design vocabulary' that people understand. That's why so many cars you see in showrooms today steal the blockiness of the new Dodge Charger or the roofline of the Toyota Prius. These elements communicate a message that people understand. Movies are made up out of bits and pieces of older movies because it's quite difficult to tell a story visually in a way that viewers will understand if you don't build on shared experience. Some "designers" are great at making print material. There's something to say for having a corporate identity that's consistent across print materials such as advertising and business cards and on the web. I know a "designer" who's an absolute CSS and HTML wizard; He even knows a little PHP and Ruby on Rails. I wouldn't trust him with data modeling, but he's got a good sense of what's possible and what's maintainable on the web, and he'll produce you a "look" that works on the web, loads fast, is compatible across browsers, etc -- he's the best kind. A critique I have of a lot of designers I work with is that they tend to think in terms of static images, not things that are parameterizable. For instance, not a single designer that I've worked with who's designed a login form has considered the question of "what does the login form look like if somebody enters the wrong password?" Often they're pretty puzzled when I push the design back to them with that question, and, except in one case, I've always had to improvise an answer to that myself. I worked for 5 years at a very political sort of organization where my first task was converting the new homepage design (a PSD) to HTML, images and CSS. It took some aggressive tricks to pull the design off and we were all proud of it when it was done. Well, the page aged poorly over 5 years, and by the time I left that job I wasn't so sure if I wanted to point to it on my resume. Every part of the organization wanted to have it's own link (or a bunch of links) on the home page and that pressure caused the site to degenerate rapidly -- it became a site for sore eyes. An excellent design anticipates that kind of change. From ajai at bitblit.net Thu Aug 20 11:17:53 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 20 Aug 2009 11:17:53 -0400 (EDT) Subject: [nycphp-talk] Working with designers In-Reply-To: <1250777268.26128@coral.he.net> Message-ID: On Thu, 20 Aug 2009, Kristina D. H. Anderson wrote: > I'd avoid like the plague any "designers" who think developers have > time to waste doing Production layouts....what's next, I don't suppose > they'd also like us to pick up their drycleaning? :) I find it bizarre that many web designers these days don't know or don't "do" HTML. Most annoying. -- Aj. From ajai at bitblit.net Thu Aug 20 11:19:39 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 20 Aug 2009 11:19:39 -0400 (EDT) Subject: [nycphp-talk] Working with designers In-Reply-To: <29da5d150908200721o72b0fdbavea04b75efbea357@mail.gmail.com> Message-ID: On Thu, 20 Aug 2009, Brian O'Connor wrote: > That really depends on how your environment is set up. If there is no > "Production department" then that very well may be the job of the > developer. I work with one other 'developer' and one 'designer' on all of > our projects. The designer hands us a PSD, and one of us is left to > translate it in to html/css/javascript. I beieve if you dont have production people then the designer should step up the plate instead punting this to your developers. -- Aj. From gatzby3jr at gmail.com Thu Aug 20 11:22:56 2009 From: gatzby3jr at gmail.com (Brian O'Connor) Date: Thu, 20 Aug 2009 11:22:56 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: <29da5d150908200721o72b0fdbavea04b75efbea357@mail.gmail.com> Message-ID: <29da5d150908200822m3dc6a015wfdfa59a94280c85d@mail.gmail.com> I think I misled you. The "company" is only 3 people. Me, the other developer, and the designer. The designer has absolutely no programming experience. He's an art major from college. It would be much quicker and more efficient for us to take the day to translate his work in to html than it would be for him to gain the 6+ years that me and the other developer have in HTML/CSS/Javascript. My point was - it depends on your situation. Our situation doesn't allow our designer to do it for us, so we do it. It's not a huge deal, it's about finding what works best between the people you have. On Thu, Aug 20, 2009 at 11:19 AM, Ajai Khattri wrote: > On Thu, 20 Aug 2009, Brian O'Connor wrote: > > > That really depends on how your environment is set up. If there is no > > "Production department" then that very well may be the job of the > > developer. I work with one other 'developer' and one 'designer' on all > of > > our projects. The designer hands us a PSD, and one of us is left to > > translate it in to html/css/javascript. > > I beieve if you dont have production people then the designer should > step up the plate instead punting this to your developers. > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Brian O'Connor -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajai at bitblit.net Thu Aug 20 11:29:38 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 20 Aug 2009 11:29:38 -0400 (EDT) Subject: [nycphp-talk] Working with designers In-Reply-To: <29da5d150908200822m3dc6a015wfdfa59a94280c85d@mail.gmail.com> Message-ID: On Thu, 20 Aug 2009, Brian O'Connor wrote: > I think I misled you. The "company" is only 3 people. Me, the other > developer, and the designer. > > The designer has absolutely no programming experience. He's an art major > from college. It would be much quicker and more efficient for us to take > the day to translate his work in to html than it would be for him to gain > the 6+ years that me and the other developer have in HTML/CSS/Javascript. > > My point was - it depends on your situation. Our situation doesn't allow > our designer to do it for us, so we do it. It's not a huge deal, it's about > finding what works best between the people you have. We have a team of developers here and we just launched a beta of a site re-design. We are just too busy dealing with site fixes and updates. Production is something which we feel belongs firmly in the designer's domain (HTML is not programming no matter what designer's say - they should know how to make their design work in HTML. In fact, a knowledge of HTML should inform their design process - the example of the login form is a good example of what happens when they don't understand that). -- Aj. From chsnyder at gmail.com Thu Aug 20 13:43:21 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 20 Aug 2009 13:43:21 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: <29da5d150908200822m3dc6a015wfdfa59a94280c85d@mail.gmail.com> Message-ID: Yes, designers should have HTML experience. But the best designers think visually, and need to have the freedom to do that. By all means hire a front-end code wrangler to save your elite programmers from tearing their hair out over IE6 compatibility, but I would never expect a top-notch graphic designer to know the first thing about good markup. There is no skillset overlap, you know? Writing HTML, CSS, and JavaScript--that's coding, not design. From ajai at bitblit.net Thu Aug 20 13:51:55 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 20 Aug 2009 13:51:55 -0400 (EDT) Subject: [nycphp-talk] Working with designers In-Reply-To: Message-ID: On Thu, 20 Aug 2009, Chris Snyder wrote: > Yes, designers should have HTML experience. But the best designers > think visually, and need to have the freedom to do that. The only problem is when a designer comes up with a design that can't be expressed in HTML or doesn't work easily with your coding framework of choice. That's what I mean when I say the HTML knowledge should inform the design process too. -- Aj. From ka at kacomputerconsulting.com Thu Aug 20 14:03:40 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Thu, 20 Aug 2009 11:03:40 -0700 Subject: [nycphp-talk] Working with designers Message-ID: <1250791420.26414@coral.he.net> Exactly. Or as they say in Brooklyn, "Fuggedaboudit, it's a website, it's not freakin' PICASSO!" Kristina > On Thu, 20 Aug 2009, Chris Snyder wrote: > > > Yes, designers should have HTML experience. But the best designers > > think visually, and need to have the freedom to do that. > > The only problem is when a designer comes up with a design that can't be > expressed in HTML or doesn't work easily with your coding framework of > choice. That's what I mean when I say the HTML knowledge should inform the > design process too. > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From ka at kacomputerconsulting.com Thu Aug 20 14:03:40 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Thu, 20 Aug 2009 11:03:40 -0700 Subject: [nycphp-talk] Working with designers Message-ID: <1250791420.26414@coral.he.net> Exactly. Or as they say in Brooklyn, "Fuggedaboudit, it's a website, it's not freakin' PICASSO!" Kristina > On Thu, 20 Aug 2009, Chris Snyder wrote: > > > Yes, designers should have HTML experience. But the best designers > > think visually, and need to have the freedom to do that. > > The only problem is when a designer comes up with a design that can't be > expressed in HTML or doesn't work easily with your coding framework of > choice. That's what I mean when I say the HTML knowledge should inform the > design process too. > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From chsnyder at gmail.com Thu Aug 20 14:19:28 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Thu, 20 Aug 2009 14:19:28 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: Message-ID: On Thu, Aug 20, 2009 at 1:51 PM, Ajai Khattri wrote: > On Thu, 20 Aug 2009, Chris Snyder wrote: > >> Yes, designers should have HTML experience. But the best designers >> think visually, and need to have the freedom to do that. > > The only problem is when a designer comes up with a design that can't be > expressed in HTML or doesn't work easily with your coding framework of > choice. That's what I mean when I say the HTML knowledge should inform the > design process too. Exactly. When a designer takes on web work they have to learn the limitations of the medium: web fonts for body text, no custom form controls, no flowed text. I'm happy to educate anyone I'm working with about what is a bad idea, what is really expensive, and what is impossible. It's not that bad, but you DO have to ask to review designs before they are sent to the client. And to the extent that we can expect people to have standards-compliant browsers with javascript, very few designs are actually impossible in HTML. Expensive to develop, perhaps, but not impossible. From paul at devonianfarm.com Thu Aug 20 14:44:06 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Thu, 20 Aug 2009 14:44:06 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: Message-ID: <4A8D9976.2010603@devonianfarm.com> Chris Snyder wrote: > > Exactly. When a designer takes on web work they have to learn the > limitations of the medium: web fonts for body text, no custom form > controls, no flowed text. I'm happy to educate anyone I'm working with > about what is a bad idea, what is really expensive, and what is > impossible. > Just as there's a difference in the skill sets of designers, there are also differences in the skill sets of developers. There's room for people on the continuum between design and software development: for instance, somebody can be a whiz in object-oriented design or a great data modeler and not know a damn thing about HTML. There's a difference between the kind of developer who knows enough html to format a table and another developer who can understand why IE8 in "Standards Mode" doesn't work with the Google Maps API... Perhaps people are expecting more than they used to, but there's an increasing amount of stuff to know about browser quirks these days, and the person who can get everything to work down to the pixel consistently in all environments is good to have on the team. That kind of person can be somebody who's basically a designer, or somebody who's basically a developer. From ramons at gmx.net Thu Aug 20 20:26:14 2009 From: ramons at gmx.net (David Krings) Date: Thu, 20 Aug 2009 20:26:14 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: Message-ID: <4A8DE9A6.3090009@gmx.net> Ajai Khattri wrote: > On Thu, 20 Aug 2009, Chris Snyder wrote: > >> Yes, designers should have HTML experience. But the best designers >> think visually, and need to have the freedom to do that. > > The only problem is when a designer comes up with a design that can't be > expressed in HTML or doesn't work easily with your coding framework of > choice. That's what I mean when I say the HTML knowledge should inform the > design process too. That would be nice, but you rather should choose the tools that suit what you want to do, not the other way around. Way too much software is dumbed down or misdesigned just because some framework doesn't do this or that or the developer is too lazy to make it so. I encounter this plenty of times and like to call it "developer arrogance". So if HTML doesn't work, use something else. Use Flash or Silverlight, or rethink the idea of making this app a browser based app. I am sure there are several other options. I heard the "VB cannot do that" whine way too often, no interest in hearing the "HTML cannot do that" whine. I know that HTML is limiting and that the stateless process is a pain in the rear at times. AJAX helps here a bit, but I think that heavy use of client side scripting makes for a bad end user experience. Good that I mention that, it all comes down to what the user wants. Not what a designer or developer think what the user needs - or what the sales guy thought he remembered from the last phone call. At the company where I work we have one developer who left the team of developers to focus solely on UI design, mainly for our browser based applications. He crafts the UI and using his developer knowledge crafts it so that the "behind the scenes" code is easily attached. But he no longer worries about how things are calculated, how they are stored in the database, or how the stored procedures work. He also often provides input for our desktop apps and it is amazing how much you can get from a really simple solution. I also worked with designers at my previous job who took the more or less raw material and the embedded that into a UI. That was the exact opposite approach and there the designers prettyfied the rough, but working product. Either way, the designer (meaning UI designer, not product designer) shouldn't just be a graphics artist or be treated as a sidekick. From product idea over coding, testing, UI design to sales and support get everyone involved from the beginning and have everyone fully understand what is supposed to get accomplished. If the project lead has no clear vision and there is no proper statement of scope, functional requirements, and tech specs you run into trouble, usually later than sooner. So when working with a designer clearly express expectations and document those. Rather spend a few hours more upfront to really get things nailed down. And there is also nothing wrong with drawing a picture or prototyping. Many people can't really grasp how something will look like, they need to see it, even if it is just a cheesy mockup. David From ramons at gmx.net Thu Aug 20 20:36:36 2009 From: ramons at gmx.net (David Krings) Date: Thu, 20 Aug 2009 20:36:36 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: Message-ID: <4A8DEC14.7070501@gmx.net> Chris Snyder wrote: >> The only problem is when a designer comes up with a design that can't be >> expressed in HTML or doesn't work easily with your coding framework of >> choice. That's what I mean when I say the HTML knowledge should inform the >> design process too. > > Exactly. When a designer takes on web work they have to learn the > limitations of the medium: web fonts for body text, no custom form > controls, no flowed text. I'm happy to educate anyone I'm working with > about what is a bad idea, what is really expensive, and what is > impossible. I think you should rather educate everyone including yourself about what the end-user wants. It is well possible that the end-user doesn't need fancy stuff and eye candy, but unless you _are_ the end-user I'd be a bit careful about ironing over all this with the "we don't need this stuff" approach. Clearly define what is asked for and required. That is why a business analyst should have no clue about coding, but know everything about the end-user / customer. And that for the same reason why developers make really bad software testers. First figure out what needs to be done and what needs to be accomplished, which is the point where everyone involved has a chance for input, but without loosing sight about, yes, you guessed it right, the end-user (which is often enough the paying customer). If after that there is still a need for custom form controls or flowed text (or whatever else) then so be it and it becomes irrelevant what the programmer thinks about it. The vast majority of software created is not used by those who make the software, so who are they to say it has to be this or that way? David From lists at nopersonal.info Sun Aug 23 00:34:37 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 23 Aug 2009 00:34:37 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <4A8D52FE.6070200@gmx.com> References: <4A8D52FE.6070200@gmx.com> Message-ID: <4A90C6DD.90300@nopersonal.info> Yitzchak Schaffer wrote: > After reading this article, I'm left wondering: what are the basics of > working with designers? I wasn't even familiar with the term "comp" > that's being used in the post and comments. Where can one learn the > fundamental assumed communication patterns, role & workflow > expectations, etc. that go along with this relationship? What is a > developer meant to do after being handed a PSD? As someone who has worked (and continues to work) on both sides of the fence I think I might be able to give you a few insights. Most of what I'm about to say relates to professionally (though not necessarily formally) trained graphic designers who offer web design services, either as independent freelancers or as members of small design firms. Before I get started: If your designer can't or won't provide a signed written agreement that clearly spells out project scope, deliverables & dates, then run away. Fast. Workflow & Terminology 1. Discovery & Planning - This usually involves giving the client a questionnaire (it may also referred to as a creative brief, creative needs analysis, design brief, etc.) It covers things like existing branding (if any), target audience, goals, expectations, look & feel, and so on. Where web sites are concerned, there may also be a "technical needs analysis" or "technical brief" (in the form of a separate section or questionnaire) that covers questions about functionality, types of media that may need to be displayed, etc. 2. Design - Brainstorming to come up with concepts (sometimes also referred to as "concepting"). The client will usually be presented with 2-3 comps (also known as roughs or mock-ups) representing what the designer considers their best concepts. The client will then be asked which design s/he prefers, and the designer will go through a couple more revisions--sometimes incorporating elements from different comps--before the design is finalized. Note: To avoid scope creep, experienced designers will specify in their contract how many rounds of revisions will be allowed, and will require sign-off on each round. 3. Production - Here's where it gets tricky. Make NO assumptions about who is going to be doing the coding. If the designer is going to be providing the HTML, then find out whether that means that the designer will actually be doing the coding, or if it's going to be outsourced (to understand why this is critically important, see Type I, below). Type I - These are the web designers who know little or nothing about coding and have no desire to learn. This is not a problem if you know for a fact that the designer outsources to a skilled, trusted coder. If you don't know and/or don't ask, then don't be surprised when you're handed HTML pages created by a Photoshop plug-in like SiteGrinder, or when you find that your coding has been outsourced to some less than reputable 3rd party online rent-a-coder outfit that has produced hopelessly buggy pages and then vanished into the night. *shudder* Type II - These are the web designers who have basic coding skills. Use caution with these designers as they often know just enough to be dangerous. They haven't mastered things like modern best practices, browser bugs, accessibility issues, semantic markup as it relates to the separation content & presentation, etc. They tend to panic when they run into things like cross-browser compatibility issues or the need for advanced CSS techniques. I know this because I have pulled the backside of more than one of them out of the fire when a deadline was looming. Type III - These are the web designers who are knowledgeable about most things code-related. Anything they don't know they will seek an answer for quickly and efficiently, and they won't over-promise. They are well versed in the areas where Type II is lacking and, if asked, can produce a portfolio & references to prove it. They have the experience to know when certain design elements might prove problematic, and they know how to keep a project on track and within scope. These designers are in the minority, but they're out there. Type IV - These are the web designers who have have all the skills of Type III, and also some degree of developer & back-end knowledge. These designers are few and far between. They know that they're worth their weight in gold and will charge accordingly. Communication This is the single biggest hurdle in any field, IMO. Graphic design, whether for the web or print, is by its very nature a highly collaborative process. A good designer should be able to communicate effectively both visually AND verbally. If the client proposes something that the designer feels will negatively impact a design, then the designer should be able to explain why in terms the client can understand. That being said, it's also incumbent upon the client to provide timely, useful feedback. I'm sure you have all experienced how difficult that can be to obtain at times. Lack of feedback not only slows down the design process, but it can also quickly dampen the designer's enthusiasm for a project, resulting in reduced creativity. Last but not least, designers & developers need to respect each other's professional expertise. I've met designers who are contemptuous of coders & developers, seeing them as little more ill-tempered, geeky "code monkeys" whose sole sense of taste lies in their mouths. Likewise, I've met coders & developers who view designers as spoiled, temperamental artistic types who deal in "make it pretty" fluff that lacks any real importance. Sometimes both are true, but most of the time not. Good design, like good web development, comes from years of hard-won experience and dedication to craft. Sorry for rambling on so long, but I don't often find a thread here that I can contribute much to, so I got a bit carried away. I hope nothing I've said comes across as preachy, and that some of you find it useful. Bev From lists at nopersonal.info Sun Aug 23 01:10:23 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 23 Aug 2009 01:10:23 -0400 Subject: [nycphp-talk] PHP Programmer's Revival Brew In-Reply-To: <003401ca1c7c$0125b010$03711030$@com> References: <003401ca1c7c$0125b010$03711030$@com> Message-ID: <4A90CF3F.1050200@nopersonal.info> Peter Sawczynec wrote: > Ginger Tea > > > Drink hot. Will taste good, spicy and sweet. > ________________________________ > > A great pick me up and can knock a cold out too. The tea sounds great, but I'm sticking with strong Cuban caf? con leche w/at least 3 tsp. sugar + cigarettes + take-out (preferably pizza, but Chinese or Mexican works too). Bev From lists at nopersonal.info Sun Aug 23 03:44:24 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 23 Aug 2009 03:44:24 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks Message-ID: <4A90F358.3010405@nopersonal.info> Hello ladies & gentlemen, I've just purchased my first book on PHP Object-Oriented Programming and have also been looking at all the frameworks that abound. I'm unsure of where to go from here. To date (and by necessity) most of my projects have been pretty simple and done in a shared hosting environment--e.g. last year I did my first Drupal site, I recently rebuilt a custom content management system that I inherited from someone else & debugged/completed a couple of years ago, and I've written a maintenance contract expiration tracker for one of our clients (which works but still needs to be polished)... Actually, that's pretty much it aside from playing with stuff in my personal sandbox. Due to my lack of programming experience, I've been doing things in a less than elegant way and I suspect this is causing me a lot of extra work, not to mention frustration. I'm loathe to move beyond my current comfort zone, but I know I MUST if I'm going to make any progress. Please bear in mind that my primary role is that of graphic/web designer, therefore I'm unable to devote as much time to my PHP/MySQL skills as I'd like. Soooo anyway, I'm looking at the possibility of using a framework that will work in a shared hosting environment and might help me develop things faster by not having to re-invent the wheel every time. Would CodeIgniter fit the bill? I have no idea how to judge which framework might be best for me, and don't want to waste time learning one that I'm going to outgrow 12 months from now. Should I even be thinking about frameworks at this point, or would I be better off reading through & understanding the OOP book first? Any advice would be greatly appreciated. Regards, Bev From lists at nopersonal.info Sun Aug 23 05:36:48 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 23 Aug 2009 05:36:48 -0400 Subject: [nycphp-talk] Advice on setting for testing server Message-ID: <4A910DB0.5040204@nopersonal.info> Okay, one last batch of questions then I'll leave you guys alone for another six months. ;-) I recently set up my first LAMP stack using Ubuntu--it seemed like the easiest option, and so far I love it. From now on this will be my local testing server. I've installed OpenSSH so I can practice "talking" to Linux & MySQL via the command line from my primary computer. I intend to perhaps also install up some sort of FTP & mail server, if for no other reason than to understand how they work on the other end. Aside from occasional shell access to remote servers and setting up cron jobs I'm a total Linux noob, so this is a whole new world for me. I've dealt with Apache .conf files a bit, and also with php.ini files. Not so much with MySQL .cnf files. At present, aside form having set passwords I'm still using the default config files that were installed with Apache 2.2.11, PHP 5.26, MySQL 5.0.75, and phpMyAdmin 3.1.2. I'd like to turn off things that are commonly disabled in shared hosting environments so that I don't inadvertently use something that's not going to work on a production server over which I have little or no control. Do any of you have recommendations on configuration settings to use? Which packages/extensions/modules should be installed/enabled? Should I go ahead and turn off error reporting and enable it via my scripts, or should I leave it on all the time? If I should leave it on, at what level should I set it? E_ALL? Are there any other settings or extensions that might be helpful someone like me who's still prone to making rookie mistakes? Would it be a good idea to use one php.ini file while I'm writing & debugging my code, and then a second one for testing immediately prior to moving to a production server? If so, how should they differ? Would this be a good time to learn how to use CVS or Subversion? As always, any advice is greatly appreciated. Regards, Bev From leam at reuel.net Sun Aug 23 07:38:37 2009 From: leam at reuel.net (Leam Hall) Date: Sun, 23 Aug 2009 07:38:37 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <4A90F358.3010405@nopersonal.info> References: <4A90F358.3010405@nopersonal.info> Message-ID: <4A912A3D.2030005@reuel.net> lists at nopersonal.info wrote: > Hello ladies & gentlemen, > > I've just purchased my first book on PHP Object-Oriented Programming and > have also been looking at all the frameworks that abound. I'm unsure of > where to go from here. Let me add to the question while the smart folks are waking up. I'm a systems (Red Hat and Solaris) guy who sees the value in PHP/{My}SQL{ite} for keeping my friends web stuff going and making information available to the decision makers at work. Currently I'm reading an old edition of "Web Database Applications with PHP and MySQL" and it's really helping me understand how things can be done. However, it doesn't use OOP, MVC, or frameworks like CakePHP, so there's obviously a grow step after this. My mind translates Bev's comments to be asking for advice on a growth pattern. My path won't be as fast as Bev's since I don't PHP every day, but having a clear path would be good. O'Reilly has a 4 part PHP course but I'm not sure I have the $$ handy for that at the moment. I do have access to lots of O'Reilly books, but knowing which ones to skim and which to focus on would help. Anyone up for drafting a "Recommended Learning Program" for PHP? Thanks! Leam From ramons at gmx.net Sun Aug 23 07:41:28 2009 From: ramons at gmx.net (David Krings) Date: Sun, 23 Aug 2009 07:41:28 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A910DB0.5040204@nopersonal.info> References: <4A910DB0.5040204@nopersonal.info> Message-ID: <4A912AE8.8040402@gmx.net> lists at nopersonal.info wrote: > Do any of you have recommendations on configuration settings to use? You may want to take a look at the popular XAMPP packages out there, most notably that from apachefriends (http://www.apachefriends.org/en/xampp.html). I think they have a sound and typical configuration. Although they don't recommend it, I used XAMPP for production use and know that this site still makes use of it. I never had any issues in the five years I ran with it. > Which packages/extensions/modules should be installed/enabled? That depends on what you need. I think anything that comes with a stock PHP install should be assumed to be available. > Should I go ahead and turn off error reporting and enable it via my > scripts, or should I leave it on all the time? If I should leave it on, > at what level should I set it? E_ALL? For a test server I'd say set it to E_ALL. You may get annoyed at times with messages, but better you get annoyed than someone else later. > Are there any other settings or extensions that might be helpful someone > like me who's still prone to making rookie mistakes? I don't think there is a removerookiemistakes extension. What you want to do is follow the best practices as much as possible and as much as known. That means make sure to protect against SQL injection, separate presentation from processing, and - in my opinion - always initialize every variable with a value at the top of the script (I include counters for loops as well) and add plenty of commentary. I ran into problems way too many times when I though i has a value of 1 when in fact it was 0 or something entirely different. I write the commentary first, typically adding a lot of detail to those areas that I know are more difficult for me. It helps me figure out what I need to do and later what I did do. Same way it hopefully helps someone else. You may want to take a look at the format used by phpdoc. It really is a nice tool and works magic even with code not commented the expected format. Lastly, whatever you do, stick with it throughout the project. You may find later that there are better ways to do things, but I'd first get it working, then optimize keeping consistency across the board. > Would it be a good idea to use one php.ini file while I'm writing & > debugging my code, and then a second one for testing immediately prior > to moving to a production server? If so, how should they differ? I'm not the typicaly PHP developer, but I'd think you want your test (and development?) sytem and production system to be configured the same. What purpose is there when you test on configuration A when in the end your production system uses configuration B? You may find things that would have failed on either configuration, but you really want to test what you are using in the end, not something else. There may be additions for debuggers or other tools that the core production use will not need, but unless it is a known security risk I'd leave it in. In the worst case of all you can still attach your development environment to the production server and debug from there. I recommend to listen to those who do more development for the outside world. I'm a hobbyist and sadly, I seem also to be the only one who consumes my scripts. > Would this be a good time to learn how to use CVS or Subversion? YES! I'd recommend to go with Subversion, but you want to use some source control. At least make clearly labeled backups of your scripts. In the end you deal with flat files that can also be compressed very well, but a source control system allows you rolling back changes and branching code. Not that you couldn't do that manually as well, but attaching a project to a source control system will make you use it. Copy and paste doesn't. David From lists at enobrev.com Sun Aug 23 10:31:50 2009 From: lists at enobrev.com (Mark Armendariz) Date: Sun, 23 Aug 2009 10:31:50 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <4A90C6DD.90300@nopersonal.info> References: <4A8D52FE.6070200@gmx.com> <4A90C6DD.90300@nopersonal.info> Message-ID: <58f08dcf0908230731s33e8d5f9sdfcc82490530c92c@mail.gmail.com> > Type I - These are the web designers who know little or nothing about > coding and have no desire to learn. This is not a problem if you know > for a fact that the designer outsources to a skilled, trusted coder. I thought this was a perfect synopsis, and this point especially stands out for me. The production should be under the watchful eye of the designer - whether they personally provide the production code or it is outsourced. Every design house worth their salt has a production specialist who knows how to hand over clean presentation code that will work perfectly on every browser. The designer's job is to care that every pixel falls perfectly into place, and the person handling production should answer to them. Regardless of where your designer falls (in those 4 well spelled out categories), you should receive quality final production html / css / (sometimes js) that they've approved and are happy with before you even begin integrating. As for my experience, I started as a graphic designer (about 12 years ago) and as a freelance PHP developer for 8 years, I've been fortunate enough to work closely with some of the best and most talented designers in the industry. Mark From lists at enobrev.com Sun Aug 23 10:44:34 2009 From: lists at enobrev.com (Mark Armendariz) Date: Sun, 23 Aug 2009 10:44:34 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A912AE8.8040402@gmx.net> References: <4A910DB0.5040204@nopersonal.info> <4A912AE8.8040402@gmx.net> Message-ID: <58f08dcf0908230744t2179babei3e047a873ef0b84b@mail.gmail.com> >> Should I go ahead and turn off error reporting and enable it via my >> scripts, or should I leave it on all the time? If I should leave it on, >> at what level should I set it? E_ALL? > > For a test server I'd say set it to E_ALL. You may get annoyed at times with > messages, but better you get annoyed than someone else later. > As a test server, errors can show site wide. Personally, I stick with E_ALL | E_STRICT, which can sometimes help with the "rookiemistakes" >> Would it be a good idea to use one php.ini file while I'm writing & >> debugging my code, and then a second one for testing immediately prior >> to moving to a production server? If so, how should they differ? > > I'm not the typicaly PHP developer, but I'd think you want your test (and > development?) sytem and production system to be configured the same. What > purpose is there when you test on configuration A when in the end your > production system uses configuration B? Besides error reporting, I could not agree more. > >> Would this be a good time to learn how to use CVS or Subversion? > > YES! I'd recommend to go with Subversion, but you want to use some source > control. You want version control as much of a habit as "Ctrl + S". It can be a pain at first and sometimes even seems silly when you start out and develop on your own. But it is Very nice to have an undo button that reaches back all the way to the first line of code you've written. Personally I'm a fan of the distributed apps (bazaar, git, mercurial). They have all the best parts of SVN and a few more goodies to boot. I tend towards bazaar specifically for portability and simplicity, but git seems to be the popular favorite. Regardless of which, I can't stress enough how useful it is to have code history. Mark From chsnyder at gmail.com Sun Aug 23 10:51:06 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Sun, 23 Aug 2009 10:51:06 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A910DB0.5040204@nopersonal.info> References: <4A910DB0.5040204@nopersonal.info> Message-ID: On Sun, Aug 23, 2009 at 5:36 AM, lists at nopersonal.info wrote: > I recently set up my first LAMP stack using Ubuntu--it seemed like the > easiest option, and so far I love it. From now on this will be my local > testing server. Congratulations! I've always thought that system administration skills are a necessary part of any web programmer's toolkit. Read the online administration manuals for Ubuntu. Definitely read man pages. No matter how dry they seem, the investment will pay off over time. You will definitely want a guide to Linux or Unix system administration. Pro Linux System Administration was published in June, and seems to successfully walk the line between the command-line and point-and-click administration schools: http://www.apress.com/book/view/1430219122 The classic guide to unix system administration is Essential System Administration: http://oreilly.com/catalog/9780596003432/ > I've installed OpenSSH so I can practice "talking" to Linux & MySQL via > the command line from my primary computer. I intend to perhaps also > install up some sort of FTP & mail server, if for no other reason than > to understand how they work on the other end. You could skip the FTP server and use SFTP, which you got for free by installing OpenSSH. If you decide to set up FTP for the experience, please make sure you use an SSL-enabled version. Ditto for your mail services. Cleartext passwords are a strong indicator of an irresponsible sysadmin. From ka at kacomputerconsulting.com Sun Aug 23 11:15:44 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Sun, 23 Aug 2009 08:15:44 -0700 Subject: [nycphp-talk] Working with designers Message-ID: <1251040544.5020@coral.he.net> >>The designer's job is to care that every pixel falls perfectly into >>place, and the person handling production should answer to them. >>Regardless of where your designer falls (in those 4 well spelled out >>categories), you should receive quality final production html / css / >>(sometimes js) that they've approved and are happy with before you >>even begin integrating. Amen, and from your lips to the Department of Answering Programmers' Prayers' ears...because it's so true, any conversation containing the dreaded word "PIXEL" is not one we want to have. Funny how they always act as though you're the first one to have the effrontery to tell them just exactly what they can DO... with their PIXEL... as IF. :> I don't mind if the form code is a bit raw and I certainly don't insist on any scripting being provided, or on a full understanding of XHTML syntax as it may relate to what exactly I'm trying to do here, but for goodness' sake just hack something together, so that the forsaken PIXELs are all where they should be and we can all move on to the next step. That way, if you don't hear from me with some utterly incomprehensible and probably completely insane concern about how your PIXEL just simply cannot reside in the precise place in the universe where you wish it to reside without causing undue havoc, you can assume that yes, your PIXEL is just exactly where you left it yesterday, safe and sound. Kristina, a/k/a "I'm really trying to care about your pixel, but it's just not working" From ajai at bitblit.net Sun Aug 23 11:18:07 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sun, 23 Aug 2009 11:18:07 -0400 (EDT) Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <4A90F358.3010405@nopersonal.info> Message-ID: On Sun, 23 Aug 2009, lists at nopersonal.info wrote: > I've just purchased my first book on PHP Object-Oriented Programming and > have also been looking at all the frameworks that abound. I'm unsure of > where to go from here. [snip] > Would CodeIgniter fit the bill? I have no idea how to judge which > framework might be best for me, and don't want to waste time learning > one that I'm going to outgrow 12 months from now. Should I even be > thinking about frameworks at this point, or would I be better off > reading through & understanding the OOP book first? I think many of us have come to that same fork in the road when making the move into frameworks. When I got into frameworks, I did read books on PHP OOP (the No Starch book is good). Since most frameworks use OOP and since they show no sign in going away, it is well worth reading up on OOP. Also, a book on design patterns probably would be useful too. As to what framework is good, that is a very subjective question. But with your newly acquired OOP knowledge you will be in a much better place to judge how they work and which ones you're comfortable with. Basically, the best thing to do would be to look at a tutorial/demo for each one, follow each one, work through and see which one makes the most sense for *you*. Other things to consider: how much documentation is there? are they easy to read? are there any books? what are the mailing lists like? how active is development of the framework? in short, how good is the community around the framework? Im not going to recommend any single one but Zend, CakePHP and symfony are pretty popular. When I made my choice, it was the excellent documentation and community that helped me decide. -- Aj. From guilhermeblanco at gmail.com Sun Aug 23 11:36:26 2009 From: guilhermeblanco at gmail.com (Guilherme Blanco) Date: Sun, 23 Aug 2009 12:36:26 -0300 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: References: <4A90F358.3010405@nopersonal.info> Message-ID: It really depends on what you plan to do. I'd suggest you Symfony and Zend Framework, but each have different approaches and different purposes. Symfony is de-facto a framework. This means all CRUD stuff is automagically generated to you. I'd suggest you to use Doctrine as ORM tool to use as part of model layer. It's a great framework, extremely easy to get basic stuff running, but quite difficult if you require a higher level of granularity. Zend Framework is a class library that can easily act as a MVC framework. This means you're able to create any type of application using a standard and WELL organized way to build it. I'd suggest you to use it for not CRUD applications (which means admin with list, add, remove, edit for each entity). It is quite easy to change source to do what you want,but it may also require little more efforts to get things done first. I have karma on both projects and I already used both frameworks. On current project, I work with Zend Framework. Cheers, On Sun, Aug 23, 2009 at 12:18 PM, Ajai Khattri wrote: > On Sun, 23 Aug 2009, lists at nopersonal.info wrote: > >> I've just purchased my first book on PHP Object-Oriented Programming and >> ?have also been looking at all the frameworks that abound. I'm unsure of >> where to go from here. > > [snip] > >> Would CodeIgniter fit the bill? I have no idea how to judge which >> framework might be best for me, and don't want to waste time learning >> one that I'm going to outgrow 12 months from now. Should I even be >> thinking about frameworks at this point, or would I be better off >> reading through & understanding the OOP book first? > > I think many of us have come to that same fork in the road when making the > move into frameworks. When I got into frameworks, I did read books on PHP > OOP (the No Starch book is good). Since most frameworks use OOP and since > they show no sign in going away, it is well worth reading up on OOP. Also, > a book on design patterns probably would be useful too. > > As to what framework is good, that is a very subjective question. But with > your newly acquired OOP knowledge you will be in a much better place to > judge how they work and which ones you're comfortable with. Basically, the > best thing to do would be to look at a tutorial/demo for each one, follow > each one, work through and see which one makes the most sense for *you*. > > Other things to consider: how much documentation is there? are they easy > to read? are there any books? what are the mailing lists like? how active > is development of the framework? in short, how good is the community > around the framework? > > Im not going to recommend any single one but Zend, CakePHP and symfony are > pretty popular. When I made my choice, it was the excellent documentation > and community that helped me decide. > > > > -- > Aj. > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco at hotmail.com URL: http://blog.bisna.com S?o Paulo - SP/Brazil From ajai at bitblit.net Sun Aug 23 11:41:38 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sun, 23 Aug 2009 11:41:38 -0400 (EDT) Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A910DB0.5040204@nopersonal.info> Message-ID: On Sun, 23 Aug 2009, lists at nopersonal.info wrote: > At present, aside form having set passwords I'm still using the default > config files that were installed with Apache 2.2.11, PHP 5.26, MySQL > 5.0.75, and phpMyAdmin 3.1.2. I'd like to turn off things that are > commonly disabled in shared hosting environments so that I don't > inadvertently use something that's not going to work on a production > server over which I have little or no control. > > Do any of you have recommendations on configuration settings to use? Most of these packages come with pretty sensible config settings so I probably would *not* mess with them without knowing the consequences. > Which packages/extensions/modules should be installed/enabled? That kind of depends on what software you're writing dont you think? Some frameworks will need additional extensions and tweaks to Apache so there is no simple fits-all rule. The other thing to consider is that any changes you make should be easy to maintain and put back after a software update. (In the case of Apache I tend to leave the main config alone since any changes will likely be overwritten when the software is updated). IIRC Ubuntu has something like a sites-enabled/sites-available folder where you can put vhost files (one per vhost is good practice). I usually create a file called ALL that contains any global config tweaks. > Should I go ahead and turn off error reporting and enable it via my > scripts, or should I leave it on all the time? If I should leave it on, > at what level should I set it? E_ALL? If you're using a framework it might already do all that for you and maybe provide its own config file for you to tweak that in. > Are there any other settings or extensions that might be helpful someone > like me who's still prone to making rookie mistakes? Firebug is good on the browser side (also look at the Web Developer Toolbar and the YSlow extension for Firebug). On the server side look at FirePHP and Xdebug extensions for PHP. > Would it be a good idea to use one php.ini file while I'm writing & > debugging my code, and then a second one for testing immediately prior > to moving to a production server? If so, how should they differ? Again, I personally would not mess with it too much unless there is a very good reason. All the caveats about maintenanced and updates apply there too. Some frameworks might need a few tweaks though but cross that bridge when you get to it. > Would this be a good time to learn how to use CVS or Subversion? All developers should be using version control. Subversion is very popular but Git is also becoming so these days. -- Aj. From mitch.pirtle at gmail.com Sun Aug 23 12:58:32 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Sun, 23 Aug 2009 12:58:32 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: References: <4A90F358.3010405@nopersonal.info> Message-ID: <330532b60908230958x780050ddn486986707aaad2ae@mail.gmail.com> On Sun, Aug 23, 2009 at 11:18 AM, Ajai Khattri wrote: > Im not going to recommend any single one but Zend, CakePHP and symfony are > pretty popular. When I made my choice, it was the excellent documentation > and community that helped me decide. Wise words - and based on Bev's design background I'm going to also mention Silverstripe, which is a CMS built upon the Sapphire framework. What makes Silverstripe unique from the usual suspects is that it goes into a page-centric design approach, meaning you write page templates for different types of content. Probably would feel completely natural to someone coming over from design and production. Ultimately you have different types of frameworks to choose from, with specific characteristics: * glue frameworks - like Zend and Joomla 1.5, glue frameworks allow you to glue together just the stuff you need to get things done. They are known to scale and perform very well, as you only incur performance hits for code you actually use. They also promote a Do It Yourself (DIY) attitude, as you ultimately decide what legos you choose to stack, and how to stack them. * stack frameworks - like CakePHP and Symfony, stack frameworks are the whole enchilada, providing developers with a rich suite of features to rapidly prototype. Stacks are usually fastest for prototyping and throwing code together, but are known to be more difficult than glue frameworks to customize to specific needs. Some say scale and performance are also issues, however your mileage may vary ;-) I like both styles of frameworks for different reasons, and there are emerging projects like Kohana (really cool!) and Silverstripe/Sapphire that have modern approaches. Both merit a serious gander, IMHO. As long as you pick one (or three) of these frameworks to play with, you will be forced in one way or another to make the leap into OO programming. The old Sitepoint books (PHP Anthology) and PHP5 Power Programming were good books for getting an understanding of solid OO practices. -- Mitch From pmjones88 at gmail.com Sun Aug 23 21:12:10 2009 From: pmjones88 at gmail.com (Paul M Jones) Date: Sun, 23 Aug 2009 20:12:10 -0500 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: References: <4A90F358.3010405@nopersonal.info> Message-ID: <5B6C7E56-9473-44E4-8C61-E19F176CCF1F@gmail.com> On Aug 23, 2009, at 10:36 , Guilherme Blanco wrote: > It really depends on what you plan to do. I believe this is well-intentioned but misguided advice. I assert that it more about "how you like to work" than it is about "what you plan to do". You can do pretty much the same things in one framework as you can in another. Some particular tasks may require more workaround effort than others in each different framework, but none of them will prevent you from doing any particular task. What you *cannot* do is change the fundamentals of how the framework wants *you* to work. Each framework makes assumptions about how you should structure your approach to the work you need to do. Each one imposes a different kind of structure to your work. Once you know how you like to do things, the best framework for your style of working will become obvious after you examine them. For an expanded take on this theme, you may wish to read my article from last year's PHP Advent, "The Framework As Franchise." http://phpadvent.org/2008/the-framework-as-franchise-by-paul-jones Hope this helps, and good luck. :-) -- Paul M. Jones http://paul-m-jones.com/ From mangesh at ascellent.co.in Mon Aug 24 01:07:31 2009 From: mangesh at ascellent.co.in (Mangesh Sathe) Date: Mon, 24 Aug 2009 10:37:31 +0530 Subject: [nycphp-talk] how to connect to an Access db *.mdb with a DSN and without a DSN. Message-ID: Hello everyone, This mangesh Sathe ,India. I have one problem in db connectivity how to connect to an Access database *.mdb with a DSN and without a DSN. I trying to do it on php 5.1 but on other sites it's maintioned that it work's only on 4.x . sample code is, $db = 'C:\\Program Files\\Northwind.mdb'; $conn = new COM('ADODB.Connection') or exit('Cannot start ADO.'); // Two ways to connect. Choose one. $conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or exit('Cannot open with Jet.'); //$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db") or exit('Cannot open with driver.'); Waiting yours Reply Thanku very much -- Thanks & Regards, Mangesh Sathe -------------- next part -------------- An HTML attachment was scrubbed... URL: From leam at reuel.net Mon Aug 24 06:09:06 2009 From: leam at reuel.net (Leam Hall) Date: Mon, 24 Aug 2009 06:09:06 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <5B6C7E56-9473-44E4-8C61-E19F176CCF1F@gmail.com> References: <4A90F358.3010405@nopersonal.info> <5B6C7E56-9473-44E4-8C61-E19F176CCF1F@gmail.com> Message-ID: <4A9266C2.1070607@reuel.net> Paul M Jones wrote: > On Aug 23, 2009, at 10:36 , Guilherme Blanco wrote: > >> It really depends on what you plan to do. > > I believe this is well-intentioned but misguided advice. I assert that > it more about "how you like to work" than it is about "what you plan to > do". ... > For an expanded take on this theme, you may wish to read my article from > last year's PHP Advent, "The Framework As Franchise." > > http://phpadvent.org/2008/the-framework-as-franchise-by-paul-jones > > Hope this helps, and good luck. :-) Paul, good article! I'm reading yours and the links it provides as well. Thanks! Leam From ka at kacomputerconsulting.com Mon Aug 24 08:01:02 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Mon, 24 Aug 2009 05:01:02 -0700 Subject: [nycphp-talk] how to connect to an Access db *.mdb with a DSN and without a DSN. Message-ID: <1251115262.17101@coral.he.net> Just a shot in the dark here, but you'd probably want to move the Access database onto a web server from your local C drive. Also, from my recollection, DSNs are only useful if you are connecting through the Windows OS, so you'd have to use the full Connection String, i.e. a DSN-less connection, to connect on the fly through PHP. There shouldn't be any reason that I can see why they discontinued support for this in PHP 5.x... Kristina > > Hello everyone, > > This mangesh Sathe ,India. > > I have one problem in db connectivity > how to connect to an Access database *.mdb with a DSN and without a DSN. > > I trying to do it on php 5.1 but on other sites it's maintioned that it > work's only on 4.x . > > sample code is, > > $db = 'C:\\Program Files\\Northwind.mdb'; > > $conn = new COM('ADODB.Connection') or exit('Cannot start ADO.'); > // Two ways to connect. Choose one. > $conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or > exit('Cannot open with Jet.'); > //$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db") or > exit('Cannot open with driver.'); > > Waiting yours Reply > > Thanku very much > > -- > Thanks & Regards, > Mangesh Sathe > > From ka at kacomputerconsulting.com Mon Aug 24 08:01:02 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Mon, 24 Aug 2009 05:01:02 -0700 Subject: [nycphp-talk] how to connect to an Access db *.mdb with a DSN and without a DSN. Message-ID: <1251115262.17101@coral.he.net> Just a shot in the dark here, but you'd probably want to move the Access database onto a web server from your local C drive. Also, from my recollection, DSNs are only useful if you are connecting through the Windows OS, so you'd have to use the full Connection String, i.e. a DSN-less connection, to connect on the fly through PHP. There shouldn't be any reason that I can see why they discontinued support for this in PHP 5.x... Kristina > > Hello everyone, > > This mangesh Sathe ,India. > > I have one problem in db connectivity > how to connect to an Access database *.mdb with a DSN and without a DSN. > > I trying to do it on php 5.1 but on other sites it's maintioned that it > work's only on 4.x . > > sample code is, > > $db = 'C:\\Program Files\\Northwind.mdb'; > > $conn = new COM('ADODB.Connection') or exit('Cannot start ADO.'); > // Two ways to connect. Choose one. > $conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or > exit('Cannot open with Jet.'); > //$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db") or > exit('Cannot open with driver.'); > > Waiting yours Reply > > Thanku very much > > -- > Thanks & Regards, > Mangesh Sathe > > From ajai at bitblit.net Mon Aug 24 10:20:00 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Mon, 24 Aug 2009 10:20:00 -0400 (EDT) Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <330532b60908230958x780050ddn486986707aaad2ae@mail.gmail.com> Message-ID: On Sun, 23 Aug 2009, Mitch Pirtle wrote: > * stack frameworks - like CakePHP and Symfony, stack frameworks are > the whole enchilada, providing developers with a rich suite of > features to rapidly prototype. Stacks are usually fastest for > prototyping and throwing code together, but are known to be more > difficult than glue frameworks to customize to specific needs. Some > say scale and performance are also issues, however your mileage may > vary ;-) I just wanted to point out that symfony can be used both ways (i.e. as a glue and as a full stack), because its main components are pretty loosely coupled and can be used separately outside the framework: http://www.symfony-project.org/blog/2008/06/23/the-symfony-1-1-architecture You can also use Zend components with symfony if you like: http://devzone.zend.com/article/1957-Using-Zend_Lucene-Inside-of-symfony There is also a long-term plan to release symfony components with docs: http://components.symfony-project.org/ As far as scalability goes, look at Yahoo Bookmarks, delicious and DailyMotion for examples of big symfony sites. http://www.symfony-project.org/blog/category/Case+studies -- Aj. From yitzchak.schaffer at gmx.com Mon Aug 24 10:56:23 2009 From: yitzchak.schaffer at gmx.com (Yitzchak Schaffer) Date: Mon, 24 Aug 2009 10:56:23 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <330532b60908230958x780050ddn486986707aaad2ae@mail.gmail.com> References: <4A90F358.3010405@nopersonal.info> <330532b60908230958x780050ddn486986707aaad2ae@mail.gmail.com> Message-ID: <4A92AA17.50608@gmx.com> Mitch Pirtle wrote: > I like both styles of frameworks for different reasons, and there are > emerging projects like Kohana (really cool!) and Silverstripe/Sapphire > that have modern approaches. Both merit a serious gander, IMHO. I've developed one major project (in progress) and one smaller one in symfony, both "standard" MySQL-based apps, the major one having (I think) a complex data model & business logic. It's been great for us, and good documentation, too. I recently worked on a project to build a new frontend on an ancient open-source digital collection management system. Because this project has its own peculiar data-storage mechanisms (not your normal database-backed system), I looked for something more open-ended, and ended up going with CodeIgniter. I found the PHP4 mix of quasi-OOP and magical function calls out of thin air [e.g. get_instance() ] to be a bit bizarre. It was only in the course of working on this project, and identifying certain issues in developing it, that I was prepared to read Zandstra's PHP Objects and really start to "get" the OOP patterns philosophy. I then heard about Kohana, which is a (more?) strictly OOP, PHP5 port of CodeIgniter. This answered my problems with CI's quirks; now, armed with my enhanced OOP understanding and Kohana, I have in the plans to rewrite my app in Kohana, when my shop's schedule allows. -- Yitzchak Schaffer Systems Manager Touro College Libraries 33 West 23rd Street New York, NY 10010 Tel (212) 463-0400 x5230 Fax (212) 627-3197 Email yitzchak.schaffer at tourolib.org From danielc at analysisandsolutions.com Mon Aug 24 12:41:48 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 24 Aug 2009 12:41:48 -0400 Subject: [nycphp-talk] how to connect to an Access db *.mdb with a DSN and without a DSN. In-Reply-To: References: Message-ID: <20090824164148.GA11@panix.com> Hi Mangesh: PHP connects to Access databases via the odbc_connect() function. The $dsn parameter is the (simple, human readable) "Data Source Name" you've assigned to the resource in Windows' ODBC Data Source Administrator. Try making a simple test script that uses odbc_connect(). Once you get that working, then try to bring ADODB into the mix. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From ka at kacomputerconsulting.com Mon Aug 24 13:54:07 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Mon, 24 Aug 2009 10:54:07 -0700 Subject: [nycphp-talk] how to connect to an Access db *.mdb with a DSN and without a DSN. Message-ID: <1251136447.29342@coral.he.net> This is specific to PHP on Windows, or...? Kristina > Hi Mangesh: > > PHP connects to Access databases via the odbc_connect() function. The > $dsn parameter is the (simple, human readable) "Data Source Name" you've > assigned to the resource in Windows' ODBC Data Source Administrator. > > Try making a simple test script that uses odbc_connect(). Once you get > that working, then try to bring ADODB into the mix. > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From AKuhn at hersheypa.com Mon Aug 24 16:34:56 2009 From: AKuhn at hersheypa.com (AKuhn at hersheypa.com) Date: Mon, 24 Aug 2009 16:34:56 -0400 Subject: [nycphp-talk] AUTO: is out of the office. (returning 08/25/2009) Message-ID: I am out of the office until 08/25/2009. I will respond to your message when I return. Note: This is an automated response to your message "Re: [nycphp-talk] Advice on OOP & Frameworks" sent on 8/24/2009 10:56:23 AM. This is the only notification you will receive while this person is away. All electronic transmissions and attachments thereto, in any form whatsoever, shall remain at all times the property of Hershey Entertainment & Resorts Company. The information contained in or attached to this electronic transmission constitutes confidential information. Any unauthorized disclosure, copying, distribution or dissemination of this information, is strictly prohibited. From y2rob at aol.com Mon Aug 24 17:21:36 2009 From: y2rob at aol.com (y2rob at aol.com) Date: Mon, 24 Aug 2009 17:21:36 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <4A90F358.3010405@nopersonal.info> References: <4A90F358.3010405@nopersonal.info> Message-ID: <8CBF317FF499533-6A4-1166C@webmail-d063.sysops.aol.com> hello bev, i personally like codeigniter, though i guess there is an offshoot framework now that's catching steam, which is built off of codeigniter, kohana. ?i've worked with zend last year when researching frameworks, as well as cakephp, but i still liked codeigniter for it's ease of doing things, as well as having a great community to ask questions - meaning the forums on the codeigniter site is very active and you're guaranteed to get a response to your questions. again, this is my personal preference and i do see similarities between all the mentioned frameworks and there are modules modeled after zend libraries that are ported to work in codeigniter and kohana, so they have to be doing something right with their framework to be a basis of these modules. i think if i were doing a large enterprise project that had sufficient budget and development time, i'd go with zend or a custom cakephp framework with the use of zend libraries for security reasons, but for the average development of websites or quick projects, i think codeigniter is the way to go; or perhaps kohana since it's built off of codeigniter. i hope this was helpful and not taken as gospel :) thanks, ~rob -----Original Message----- From: lists at nopersonal.info To: NYPHP Talk Sent: Sun, Aug 23, 2009 3:44 am Subject: [nycphp-talk] Advice on OOP & Frameworks Hello ladies & gentlemen, I've just purchased my first book on PHP Object-Oriented Programming and have also been looking at all the frameworks that abound. I'm unsure of where to go from here. To date (and by necessity) most of my projects have been pretty simple and done in a shared hosting environment--e.g. last year I did my first Drupal site, I recently rebuilt a custom content management system that I inherited from someone else & debugged/completed a couple of years ago, and I've written a maintenance contract expiration tracker for one of our clients (which works but still needs to be polished)... Actually, that's pretty much it aside from playing with stuff in my personal sandbox. Due to my lack of programming experience, I've been doing things in a less than elegant way and I suspect this is causing me a lot of extra work, not to mention frustration. I'm loathe to move beyond my current comfort zone, but I know I MUST if I'm going to make any progress. Please bear in mind that my primary role is that of graphic/web designer, therefore I'm unable to devote as much time to my PHP/MySQL skills as I'd like. Soooo anyway, I'm looking at the possibility of using a framework that will work in a shared hosting environment and might help me develop things faster by not having to re-invent the wheel every time. Would CodeIgniter fit the bill? I have no idea how to judge which framework might be best for me, and don't want to waste time learning one that I'm going to outgrow 12 months from now. Should I even be thinking about frameworks at this point, or would I be better off reading through & understanding the OOP book first? Any advice would be greatly appreciated. Regards, Bev _______________________________________________ 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 danielc at analysisandsolutions.com Mon Aug 24 23:58:52 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 24 Aug 2009 23:58:52 -0400 Subject: [nycphp-talk] PHP testing for a password protected folder/file In-Reply-To: <371125141.20090811215917@vbplusme.com> References: <371125141.20090811215917@vbplusme.com> Message-ID: <20090825035852.GA17421@panix.com> Hi, uh, whoever you are: On Tue, Aug 11, 2009 at 09:59:17PM +0800, webmaster at vbplusme.com wrote: > > I have an errorpage script that checks for > $_SERVER['REDIRECT_STATUS'] and delivers a user friendly message > depending on which error condition it finds, works great most of the > time. The problem is when is encountered a password protected > folder, it delivers the 401 or 403 error message and completely > ignores/bypasses the popup username/password window that usually > occurs in .htaccess password protected folders. I'm guessing your error handler is in the same directory that you're blocking, so Apache isn't letting you anywhere near executing the PHP code inside your PHP error handler script. Put your error handler in the top most directory of the document root, say "/auth_error.php". In directories you want protected, have the following in your .htaccess files: ErrorDocument 401 /auth_error.php ErrorDocument 403 /auth_error.php --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at nopersonal.info Tue Aug 25 09:49:39 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 09:49:39 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <58f08dcf0908230731s33e8d5f9sdfcc82490530c92c@mail.gmail.com> References: <4A8D52FE.6070200@gmx.com> <4A90C6DD.90300@nopersonal.info> <58f08dcf0908230731s33e8d5f9sdfcc82490530c92c@mail.gmail.com> Message-ID: <4A93EBF3.1090306@nopersonal.info> Mark Armendariz wrote: > As for my experience, I started as a graphic designer (about 12 years > ago) and as a freelance PHP developer for 8 years, I've been fortunate > enough to work closely with some of the best and most talented > designers in the industry. That's good to know. I love doing both, but don't run across many people who feel the same. I registered for the NYC CodeWorks conference this weekend, so I hope I'll get to meet some of you in October. Bev From lists at nopersonal.info Tue Aug 25 10:17:07 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 10:17:07 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <4A912A3D.2030005@reuel.net> References: <4A90F358.3010405@nopersonal.info> <4A912A3D.2030005@reuel.net> Message-ID: <4A93F263.3020200@nopersonal.info> Leam Hall wrote: > Anyone up for drafting a "Recommended Learning Program" for PHP? That sounds like a great idea, Leam. I'd be willing to work on it to the degree that my current knowledge permits (since most of my stumbles are still fresh in my mind). Maybe we can start a new thread about that, or talk with the more experienced members of the group at the upcoming conference? Bev From lhall at smartronix.com Tue Aug 25 10:25:29 2009 From: lhall at smartronix.com (Hall, Leam) Date: Tue, 25 Aug 2009 10:25:29 -0400 Subject: [nycphp-talk] And can you have that by end of week? Message-ID: <77D302D8-1197-48D1-8535-677B61E06EF2@mimectl> Yikes! I showed my boss the results of a script that took a 400-800 page report and put it into a 10 page synopsis. Now he wants it sortable by host name, adding a couple click boxes, and linking to a personell list that's still being formed. And by end of week! Did I mention I'm a server guy and not a real programmer? :) I have some ideas but man it's going to be a fun challenge... Leam -------------- next part -------------- An HTML attachment was scrubbed... URL: From lhall at smartronix.com Tue Aug 25 10:59:21 2009 From: lhall at smartronix.com (Hall, Leam) Date: Tue, 25 Aug 2009 10:59:21 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <4A93F263.3020200@nopersonal.info> References: <4A90F358.3010405@nopersonal.info> <4A912A3D.2030005@reuel.net>, <4A93F263.3020200@nopersonal.info> Message-ID: Some years ago I took the SAGE list for systems administrators as a set of goals. It broke down what sorts of things you should be able to do as a beginner, intermediate, and advanced sysadmin. Not everyone does their best with a structure but I certainly do. Main things are what sorts of things folks should be able to do at what levels. The "Apprentice", "Journeyman", and "Master" levels work for lots of things, but what would each person need to be able to do? Leam From: lists at nopersonal.info Sent: Tue 8/25/2009 10:17 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Advice on OOP & Frameworks Leam Hall wrote: > Anyone up for drafting a "Recommended Learning Program" for PHP? That sounds like a great idea, Leam. I'd be willing to work on it to the degree that my current knowledge permits (since most of my stumbles are still fresh in my mind). Maybe we can start a new thread about that, or talk with the more experienced members of the group at the upcoming conference? Bev _______________________________________________ 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 mitch.pirtle at gmail.com Tue Aug 25 11:09:09 2009 From: mitch.pirtle at gmail.com (Mitch Pirtle) Date: Tue, 25 Aug 2009 11:09:09 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: References: <4A90F358.3010405@nopersonal.info> <4A912A3D.2030005@reuel.net> <4A93F263.3020200@nopersonal.info> Message-ID: <330532b60908250809w3bac32e4h22320ec96d56030@mail.gmail.com> Ok, now I gotta pimp a book. Pragmatic Thinking and Learning, by Pragmatic Publishers: http://www.pragprog.com/titles/ahptl/pragmatic-thinking-and-learning They mention the Dreyfus model of competence levels, which is an awesome read in itself. I encourage everyone to read this book, it will certainly change the way you think, the way you assess your own skills, and evaluate others. I'd consider that an awesome start. -- Mitch On Tue, Aug 25, 2009 at 10:59 AM, Hall, Leam wrote: > Some years ago I took the SAGE list for systems administrators as a set of > goals. It broke down what sorts of things you should be able to do as a > beginner, intermediate, and advanced sysadmin. Not everyone does their best > with a structure but I certainly do. > > Main things are what sorts of things folks should be able to do at what > levels. The "Apprentice", "Journeyman", and "Master" levels work for lots of > things, but what would each person need to be able to do? > > Leam > ________________________________ > From: lists at nopersonal.info > Sent: Tue 8/25/2009 10:17 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Advice on OOP & Frameworks > > Leam Hall wrote: > >> Anyone up for drafting a "Recommended Learning Program" for PHP? > > That sounds like a great idea, Leam. I'd be willing to work on it to the > degree that my current knowledge permits (since most of my stumbles are > still fresh in my mind). > > Maybe we can start a new thread about that, or talk with the more > experienced members of the group at the upcoming conference? > > Bev > > > _______________________________________________ > 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 lists at nopersonal.info Tue Aug 25 11:45:00 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 11:45:00 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: References: Message-ID: <4A9406FC.2030605@nopersonal.info> I hope responding to everyone in one email won't be considered rude, but it seemed to be easier than making everyone open half a dozen emails. Ajai - Thanks for the great info on frameworks (esp. the OOP part) and for the advice on what to look for. Guilherme - CRUD, ORM, MVC... so many terms & concepts I need to learn! Thanks for the specific info on Symfony & Zend and which situations they're best for. Paul - Excellent advice and article. I've bookmarked you site and some of the other articles you linked to. Thanks! Mitch - Thanks for the heads-up on Silverstripe, but even more so for the definitions of glue & stack frameworks--that was a HUGE help. Yitzchak - Thanks for adding your experiences. I think Ajai was right--getting a basic understanding of OOP will probably help me figure out what will work best for both me & my future projects. Rob - I ran across mention of Kohana when googling for info on CodeIgniter, and both sound like things that might work well for me. Thanks for sharing what you found in your search for a framework--it's really helpful to hear other people's experiences. Well, it looks like I've got some new homework to do. Thanks again to all of you for your patient advice. You're the best! Regards, Bev From lists at nopersonal.info Tue Aug 25 12:06:12 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 12:06:12 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: References: <4A90F358.3010405@nopersonal.info> <4A912A3D.2030005@reuel.net>, <4A93F263.3020200@nopersonal.info> Message-ID: <4A940BF4.6040705@nopersonal.info> Hall, Leam wrote: > Some years ago I took the SAGE list for systems administrators as a set > of goals. It broke down what sorts of things you should be able to do as > a beginner, intermediate, and advanced sysadmin. Not everyone does their > best with a structure but I certainly do. Wow, that must have taken some work. I like structure myself, as long as it's not too rigid. I only wish there'd been more of it when I was first learning to do front-end coding years ago. > Main things are what sorts of things folks should be able to do at what > levels. The "Apprentice", "Journeyman", and "Master" levels work for > lots of things, but what would each person need to be able to do? I keep a simple web design reading list online for print designers & and aspiring coders/web designers that come to some of the forums I participate in. It's an easy way to point them toward the kinds of things they'll need to know, but I really like your "levels" approach. I've also developed a couple of checklists for things like launching (static) web sites and migrating dynamic sites. The latter is revised each time I (screw up and) learn something new about PHP/MySQL & other back-end issues. Bev From lists at nopersonal.info Tue Aug 25 12:09:22 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 12:09:22 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <330532b60908250809w3bac32e4h22320ec96d56030@mail.gmail.com> References: <4A90F358.3010405@nopersonal.info> <4A912A3D.2030005@reuel.net> <4A93F263.3020200@nopersonal.info> <330532b60908250809w3bac32e4h22320ec96d56030@mail.gmail.com> Message-ID: <4A940CB2.2040207@nopersonal.info> Mitch Pirtle wrote: > Ok, now I gotta pimp a book. Pragmatic Thinking and Learning, by > Pragmatic Publishers: > > http://www.pragprog.com/titles/ahptl/pragmatic-thinking-and-learning > > They mention the Dreyfus model of competence levels, which is an > awesome read in itself. I encourage everyone to read this book, it > will certainly change the way you think, the way you assess your own > skills, and evaluate others. Mitch, that looks REALLY interesting. It's definitely going to the top of my Amazon wish list. Regards, Bev From lists at nopersonal.info Tue Aug 25 12:30:44 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 12:30:44 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A912AE8.8040402@gmx.net> References: <4A910DB0.5040204@nopersonal.info> <4A912AE8.8040402@gmx.net> Message-ID: <4A9411B4.7090805@nopersonal.info> David, thanks for all the advice, especially the reminder to follow best practices and mind my variables. I'll take a look at the XAMPP config files, stick with my stock installation, and keep error reporting set to E_ALL. > I don't think there is a removerookiemistakes extension. Drat! Someone should create one. ;o) >> Would this be a good time to learn how to use CVS or Subversion? > YES! I'd recommend to go with Subversion, but you want to use some > source control. At least make clearly labeled backups of your scripts. > In the end you deal with flat files that can also be compressed very > well, but a source control system allows you rolling back changes and > branching code. Not that you couldn't do that manually as well, but > attaching a project to a source control system will make you use it. > Copy and paste doesn't. Yeah, making manual backups is tedious and I've messed things up doing it that way on more than one occasion. *sigh* I guess I've been avoiding the whole version control thing because it sounded a little scary, but it sounds like something that could be a real lifesaver, so I guess I need to get over myself and just do it. Bev From lists at nopersonal.info Tue Aug 25 12:33:26 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 12:33:26 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <58f08dcf0908230744t2179babei3e047a873ef0b84b@mail.gmail.com> References: <4A910DB0.5040204@nopersonal.info> <4A912AE8.8040402@gmx.net> <58f08dcf0908230744t2179babei3e047a873ef0b84b@mail.gmail.com> Message-ID: <4A941256.5010708@nopersonal.info> Mark Armendariz wrote: > You want version control as much of a habit as "Ctrl + S". It can be > a pain at first and sometimes even seems silly when you start out and > develop on your own. But it is Very nice to have an undo button that > reaches back all the way to the first line of code you've written. Point taken. > Personally I'm a fan of the distributed apps (bazaar, git, mercurial). > They have all the best parts of SVN and a few more goodies to boot. > I tend towards bazaar specifically for portability and simplicity, but > git seems to be the popular favorite. I'll definitely look into those also. Thanks! Bev From lists at nopersonal.info Tue Aug 25 13:07:14 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 13:07:14 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: References: <4A910DB0.5040204@nopersonal.info> Message-ID: <4A941A42.4080508@nopersonal.info> Chris Snyder wrote: > Congratulations! I've always thought that system administration skills > are a necessary part of any web programmer's toolkit. I couldn't agree more--the need for it has become clearer & clearer as I inch my way forward. The company I work for is an outfit of network security consultants, so my boss is totally on board with me learning more about Linux sys admin skills. Now that I've had a couple of weeks to poke around in Ubuntu's innards, I find it fascinating. Now Windows kinda is starting to seem like Linux's idiot cousin. Still, it's a big paradigm shift for me, you know? Last week it took me like 2 hours to figure out how to gain write access to a mounted logical drive because I wasn't grasping the whole ownership/users/groups thing. Now it makes more sense and I can see why it's more secure. > Read the online administration manuals for Ubuntu. Definitely read man > pages. No matter how dry they seem, the investment will pay off over > time. LOL, yeah, I usually tend to just jump in with both feet, but that's clearly NOT going to work in this case. Linux is just too different form what I'm accustomed to for that approach to work. > You will definitely want a guide to Linux or Unix system > administration. Pro Linux System Administration was published in June, > and seems to successfully walk the line between the command-line and > point-and-click administration schools: > http://www.apress.com/book/view/1430219122 > > The classic guide to unix system administration is Essential System > Administration: http://oreilly.com/catalog/9780596003432/ Thanks. Man, Amazon is going to get a lot more of my money next month... > You could skip the FTP server and use SFTP, which you got for free by > installing OpenSSH. If you decide to set up FTP for the experience, > please make sure you use an SSL-enabled version. Ditto for your mail > services. Cleartext passwords are a strong indicator of an > irresponsible sysadmin. Duh--I didn't even realize SFTP came with OpenSSH. *headdesk* I've managed to connect now using PuTTY, so thanks for pointing that out. I guess I'll forgo the FTP & mail services for now since the Ubuntu box is on my home LAN and I don't really need them. I also managed to set up my computer's wake-on-lan feature. It's so cool to be able to control the web server from any computer in my apartment (I work from home and don't foresee any need to access it from outside my LAN). I have a mostly wired network with my single wireless access point & laptop set up by one of our engineers to ensure that it was secure, so I guess that should be good enough. Bev From lists at nopersonal.info Tue Aug 25 13:26:06 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 13:26:06 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: References: Message-ID: <4A941EAE.90201@nopersonal.info> Ajai Khattri wrote: >> Do any of you have recommendations on configuration settings to use? > > Most of these packages come with pretty sensible config settings so I > probably would *not* mess with them without knowing the consequences. Duly noted. >> Which packages/extensions/modules should be installed/enabled? > > That kind of depends on what software you're writing dont you think? Ah, right--thinking. Sometimes I forget to do that. Yes, that would be a sensible thing to consider. :-) >Some > frameworks will need additional extensions and tweaks to Apache so there > is no simple fits-all rule. The other thing to consider is that any > changes you make should be easy to maintain and put back after a software > update. (In the case of Apache I tend to leave the main config alone since > any changes will likely be overwritten when the software is updated). IIRC > Ubuntu has something like a sites-enabled/sites-available folder where you > can put vhost files (one per vhost is good practice). I usually create a > file called ALL that contains any global config tweaks. > >> Should I go ahead and turn off error reporting and enable it via my >> scripts, or should I leave it on all the time? If I should leave it on, >> at what level should I set it? E_ALL? > > If you're using a framework it might already do all that for you and maybe > provide its own config file for you to tweak that in. I'll look into all that, thanks. > Firebug is good on the browser side (also look at the Web Developer > Toolbar and the YSlow extension for Firebug). On the server side look at > FirePHP and Xdebug extensions for PHP. > Firebug, YSlow, and the Web Developer Toolbar have been my best friends for front-end work for quite some time. I've seen the FirePHP & Xdebug extensions but didn't really understand how to use them, so I just ignored them. Now that you've mentioned them I'll go back and give them a closer look. > All developers should be using version control. Subversion is very popular > but Git is also becoming so these days. Understood. Bev From matt at atopia.net Tue Aug 25 13:51:01 2009 From: matt at atopia.net (Matt Juszczak) Date: Tue, 25 Aug 2009 13:51:01 -0400 (EDT) Subject: [nycphp-talk] Simple MySQL web based form creator? Message-ID: I have a single table, with about 20 fields, 2 enum's, etc. I'm looking for a simple tool that can wrap a form around this table and allow people to update/edit it. I feel phpmyadmin would work but it's way too complex for this project. Any suggestions? From tegwe002 at umn.edu Tue Aug 25 13:50:55 2009 From: tegwe002 at umn.edu (Joelle Tegwen) Date: Tue, 25 Aug 2009 12:50:55 -0500 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A910DB0.5040204@nopersonal.info> References: <4A910DB0.5040204@nopersonal.info> Message-ID: <4A94247F.9010500@umn.edu> I switched over from Windows a couple of years ago. I'm not a pro, but I found a few things that were frustrating for me as I switched distros or got a new machine. Here's my advice that others have not already covered. 1) Take the time to figure out how to move your /home to another partition. 2) I use E_ALL | E_STRICT. Then you know you're good regardless of the production server settings. 3) Find a way to reproduce the environment on your machine. This caused me no end of headaches at first because it took me days to finally remember all of the applications I needed installed and figuring out how they were configured different. I created two files. The first is a shell script that installs all of the applications I use, changes settings/permissions and makes copies of config files. Then you've always got your back covered. The second is instructions and information about how to manually change things that need to be manually changed. (config files, etc) . The only trick is being religious about updating the files every time you install/configure applications. However, this made my last hardware upgrade go wickedly fast. So for LAMP I've got this: (script) sudo tasksel install lamp-server #extensions sudo apt-get install -y sendmail php-pear php5-mysql php5-ldap php5-xsl php5-xdebug php5-curl php5-mcrypt sudo mkdir /var/lib/php5/session sudo chgrp www-data /var/lib/php5/session sudo chmod g+w /var/lib/php5/session sudo pear channel-discover pear.phpunit.de sudo pear install phpunit/PHPUnit sudo pear install phpunit/phpcpd cd /etc/php/apache2 sudo cp php.ini php.ini.original cd /etc/mysql sudo cp my.cnf my.cnf.original (config) cd /etc/php5/apache2/ gksudo gedit php.ini & # see php.ini.diff diff php.ini php.ini.original > ~/howtos/php.ini.diff cd /etc/mysql/ gksudo gedit my.cnf & # see my.cnf.diff diff my.cnf my.cnf.original > ~/howtos/my.cnf.diff Where php.ini.diff looks like this: 390c390 < error_log = /localhost/web_logs/php_errors.txt --- > ;error_log = filename 1007c1007 < session.gc_maxlifetime = 14400 --- > session.gc_maxlifetime = 1440 HTH J lists at nopersonal.info wrote: > Okay, one last batch of questions then I'll leave you guys alone for > another six months. ;-) > > I recently set up my first LAMP stack using Ubuntu--it seemed like the > easiest option, and so far I love it. From now on this will be my local > testing server. > > I've installed OpenSSH so I can practice "talking" to Linux & MySQL via > the command line from my primary computer. I intend to perhaps also > install up some sort of FTP & mail server, if for no other reason than > to understand how they work on the other end. > > Aside from occasional shell access to remote servers and setting up cron > jobs I'm a total Linux noob, so this is a whole new world for me. I've > dealt with Apache .conf files a bit, and also with php.ini files. Not so > much with MySQL .cnf files. > > At present, aside form having set passwords I'm still using the default > config files that were installed with Apache 2.2.11, PHP 5.26, MySQL > 5.0.75, and phpMyAdmin 3.1.2. I'd like to turn off things that are > commonly disabled in shared hosting environments so that I don't > inadvertently use something that's not going to work on a production > server over which I have little or no control. > > Do any of you have recommendations on configuration settings to use? > > Which packages/extensions/modules should be installed/enabled? > > Should I go ahead and turn off error reporting and enable it via my > scripts, or should I leave it on all the time? If I should leave it on, > at what level should I set it? E_ALL? > > Are there any other settings or extensions that might be helpful someone > like me who's still prone to making rookie mistakes? > > Would it be a good idea to use one php.ini file while I'm writing & > debugging my code, and then a second one for testing immediately prior > to moving to a production server? If so, how should they differ? > > Would this be a good time to learn how to use CVS or Subversion? > > As always, any advice is greatly appreciated. > > Regards, > Bev > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From greg.rundlett at gmail.com Tue Aug 25 14:03:14 2009 From: greg.rundlett at gmail.com (G Rundlett) Date: Tue, 25 Aug 2009 14:03:14 -0400 Subject: [nycphp-talk] Simple MySQL web based form creator? In-Reply-To: References: Message-ID: <5e2aaca40908251103o6b91dfe6hb772232ab839dc2c@mail.gmail.com> On Tue, Aug 25, 2009 at 1:51 PM, Matt Juszczak wrote: > I have a single table, with about 20 fields, 2 enum's, etc. ?I'm looking for > a simple tool that can wrap a form around this table and allow people to > update/edit it. ?I feel phpmyadmin would work but it's way too complex for > this project. > > Any suggestions? phpgrid is a commercial option. ~$100 for a single dev license and $400 for a site license (I have no affiliation, I've just used it) Greg Rundlett nbpt 978-225-8302 m. 978-764-4424 -skype/aim/irc/twitter freephile http://profiles.aim.com/freephile From lists at nopersonal.info Tue Aug 25 14:09:31 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 14:09:31 -0400 Subject: [nycphp-talk] Simple MySQL web based form creator? In-Reply-To: References: Message-ID: <4A9428DB.9000100@nopersonal.info> Matt Juszczak wrote: > I have a single table, with about 20 fields, 2 enum's, etc. I'm looking > for a simple tool that can wrap a form around this table and allow > people to update/edit it. I feel phpmyadmin would work but it's way too > complex for this project. > > Any suggestions? Maybe this? http://www.dadabik.org/ I used it a couple of years ago to allow a client to manage the data from his form submissions. Bev From chsnyder at gmail.com Tue Aug 25 14:12:28 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Tue, 25 Aug 2009 14:12:28 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A94247F.9010500@umn.edu> References: <4A910DB0.5040204@nopersonal.info> <4A94247F.9010500@umn.edu> Message-ID: On Tue, Aug 25, 2009 at 1:50 PM, Joelle Tegwen wrote: > I created two files. The first is a shell script that installs all of the > applications I use, changes settings/permissions and makes copies of config > files. Then you've always got your back covered. The second is instructions > and information about how to manually change things that need to be manually > changed. (config files, etc) . The only trick is being religious about > updating the files every time you install/configure applications. However, > this made my last hardware upgrade go wickedly fast. Yes! This is a great piece of advice, and not immediately obvious to folks who are new to command line administration. Even if you mix your instructions and commands, being able to copy and paste the commands in order saves a LOT of time and allows you the full benefit of your collected wisdom and experience. It's a good idea to set up a wiki for your personal use as a sysadmin, to store recipes like this, and make them easy to update with each new install. The only thing worse than spending hours getting a configuration exactly right is realizing two years later that you didn't paste-and-save it anywhere. From lists at nopersonal.info Tue Aug 25 14:40:32 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 14:40:32 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A94247F.9010500@umn.edu> References: <4A910DB0.5040204@nopersonal.info> <4A94247F.9010500@umn.edu> Message-ID: <4A943020.6000002@nopersonal.info> Joelle Tegwen wrote: > Here's my advice that others have not already covered. > 1) Take the time to figure out how to move your /home to another partition. I saw a reference to that the other day while searching for something else and made a mental not that I needed to come back to it. The fact that you've pointed out it's importance is a big help. I think I'll make that my next thing to learn. > 2) I use E_ALL | E_STRICT. Then you know you're good regardless of the > production server settings. That makes sense. > 3) Find a way to reproduce the environment on your machine. This caused > me no end of headaches at first because it took me days to finally > remember all of the applications I needed installed and figuring out how > they were configured different. > > I created two files.... Joelle, thank you soooo much for sharing this--you've undoubtedly saved me hours (maybe even days) of aggravation with your script & config settings! *happy dance* Regards, Bev From lists at nopersonal.info Tue Aug 25 14:46:53 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Tue, 25 Aug 2009 14:46:53 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: References: <4A910DB0.5040204@nopersonal.info> <4A94247F.9010500@umn.edu> Message-ID: <4A94319D.2080802@nopersonal.info> Chris Snyder wrote: > It's a good idea to set up a wiki for your personal use as a sysadmin, > to store recipes like this, and make them easy to update with each new > install. The only thing worse than spending hours getting a > configuration exactly right is realizing two years later that you > didn't paste-and-save it anywhere. I've been meaning to do that for the longest time for browser bugs & such. As a matter of fact, I even set up a a couple of wikis at one point and then abandoned them because I didn't care for the way they worked. I guess now would be the optimal time to start over as I'll likely be tripping myself up quite a bit during the learning process. Do you have any recommendations on a good one to use? Bev From danielc at analysisandsolutions.com Tue Aug 25 14:47:29 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 25 Aug 2009 14:47:29 -0400 Subject: [nycphp-talk] Simple MySQL web based form creator? In-Reply-To: References: Message-ID: <20090825184729.GB14995@panix.com> Hey Matt: On Tue, Aug 25, 2009 at 01:51:01PM -0400, Matt Juszczak wrote: > I have a single table, with about 20 fields, 2 enum's, etc. I'm looking > for a simple tool that can wrap a form around this table and allow people > to update/edit it. Here's a very crude SQL package I made when I started working with PHP oh so many years ago. http://www.analysisandsolutions.com/software/sql/ See the RecordAsInput() method. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tedd at sperling.com Tue Aug 25 14:50:47 2009 From: tedd at sperling.com (tedd) Date: Tue, 25 Aug 2009 14:50:47 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <4A93EBF3.1090306@nopersonal.info> References: <4A8D52FE.6070200@gmx.com> <4A90C6DD.90300@nopersonal.info> <58f08dcf0908230731s33e8d5f9sdfcc82490530c92c@mail.gmail.com> <4A93EBF3.1090306@nopersonal.info> Message-ID: At 9:49 AM -0400 8/25/09, lists at nopersonal.info wrote: >Mark Armendariz wrote: > >> As for my experience, I started as a graphic designer (about 12 years >> ago) and as a freelance PHP developer for 8 years, I've been fortunate >> enough to work closely with some of the best and most talented >> designers in the industry. > >That's good to know. I love doing both, but don't run across many people >who feel the same. > >Bev Bev: Me too -- I'm a one man band combining graphic design, html, css, javascript ajax, php and mysql all rolled into one while observing best practices, unobtrusive and semantic code, and addressing W3C compliance and accessibility issues. In other words, there's a lot to know to get it right. I can see how the division of responsibility can become blurred in a team environment while working on large projects. Fortunately for me, my projects don't normally exceed $20k and that appears to be a nice cut-off for me. In my experience, projects that are larger can go to a team, those smaller can be handled by one person. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From oorza2k5 at gmail.com Tue Aug 25 14:54:57 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Tue, 25 Aug 2009 14:54:57 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A94319D.2080802@nopersonal.info> References: <4A910DB0.5040204@nopersonal.info> <4A94247F.9010500@umn.edu> <4A94319D.2080802@nopersonal.info> Message-ID: <68de37340908251154r781bdae5q9fb197d5e1c62254@mail.gmail.com> On Tue, Aug 25, 2009 at 2:46 PM, lists at nopersonal.info wrote: > Chris Snyder wrote: >> It's a good idea to set up a wiki for your personal use as a sysadmin, >> to store recipes like this, and make them easy to update with each new >> install. The only thing worse than spending hours getting a >> configuration exactly right is realizing two years later that you >> didn't paste-and-save it anywhere. > > I've been meaning to do that for the longest time for browser bugs & > such. As a matter of fact, I even set up a a couple of wikis at one > point and then abandoned them because I didn't care for the way they > worked. > > I guess now would be the optimal time to start over as I'll likely be > tripping myself up quite a bit during the learning process. > > Do you have any recommendations on a good one to use? > > Bev > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > I maintain a wiki that other people have to use, so I use MediaWiki, because it's pretty unlikely that there's anyone I'm likely to work with that is unfamiliar with the layout and features it offers, because of wikipedia's prevalance. It's relatively easy to install and hack at, so I'd recommend it. From danielc at analysisandsolutions.com Tue Aug 25 15:00:01 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 25 Aug 2009 15:00:01 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A94247F.9010500@umn.edu> References: <4A910DB0.5040204@nopersonal.info> <4A94247F.9010500@umn.edu> Message-ID: <20090825190001.GC14995@panix.com> Hi Joelle: On Tue, Aug 25, 2009 at 12:50:55PM -0500, Joelle Tegwen wrote: > > I created two files. The first is a shell script that installs all of > the applications I use, changes settings/permissions and makes copies of > config files. Then you've always got your back covered. The second is > instructions and information about how to manually change things that > need to be manually changed. (config files, etc) . Yep. Great advice. Shell scripts are an amazing way to save time and improve accuracy. And I bet you can script even more of the process. For example, you were saying you manually edit your config files. There are two ways to automate config file modifications. 1) Have a copy of the config file in your version control system (subversion, cvs, git, etc) that your installation script exports and copies into place. 2) Have a unified diff (diff -u php.ini-production php.ini > ini.diff) of your configuration file in your version control system that your shell script exports then calls: patch -i ./ini.diff $php_path/php.ini-development -o $php_path/php.ini --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From nelly at cgim.com Tue Aug 25 15:07:51 2009 From: nelly at cgim.com (Nelly Yusupova) Date: Tue, 25 Aug 2009 15:07:51 -0400 Subject: [nycphp-talk] Time zone based on country/state/city In-Reply-To: <4A943020.6000002@nopersonal.info> Message-ID: Hello Everyone, Is there a way to figure out a time zone based on country/state/city. I searched the web and could not find any resources. Thank you in advance. Sincerely, Nelly Yusupova Webgrrls.com nelly at cgim.com 917 603-9226 (phone) URL: http://www.webgrrls.com Blog: http://www.webgrrls.com/blog/ Twitter: http://twitter.com/DigitalWoman From tegwe002 at umn.edu Tue Aug 25 15:21:14 2009 From: tegwe002 at umn.edu (Joelle Tegwen) Date: Tue, 25 Aug 2009 14:21:14 -0500 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <20090825190001.GC14995@panix.com> References: <4A910DB0.5040204@nopersonal.info> <4A94247F.9010500@umn.edu> <20090825190001.GC14995@panix.com> Message-ID: <4A9439AA.3080501@umn.edu> > And I bet you can script even more of the process. For example, you were > saying you manually edit your config files. There are two ways to > automate config file modifications. > > 1) Have a copy of the config file in your version control system > (subversion, cvs, git, etc) that your installation script exports and > copies into place. > > 2) Have a unified diff (diff -u php.ini-production php.ini > ini.diff) of > your configuration file in your version control system that your shell > script exports then calls: > > patch -i ./ini.diff $php_path/php.ini-development -o $php_path/php.ini > > Ah! I couldn't figure that part out. Excellent idea. Thanks! J From lhall at smartronix.com Tue Aug 25 15:27:51 2009 From: lhall at smartronix.com (Hall, Leam) Date: Tue, 25 Aug 2009 15:27:51 -0400 Subject: [nycphp-talk] Input as array names Message-ID: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl> Okay, here's one of the places I don't really get and can use some help on. On my text processing script I'm going to slurp up host names. They come in as the first, counting from 0, element. I can explode and create the array, which gives me a string: $hostname[1] = somehost.example.com I can safely get rid of the ".example.com" bit, leaving $hostname[1] as "somehost". What I need to understand is how to take $hostname[1] and make it an array in it's own right so I can assign it a list of numbers. For example, my text file looks something like this: Bug ID: 1234 Affected Machines: somehost1 somehost2.example.com somehostwehavenotseeninyears.example.com Bug ID: 3456 Affected Machines: somehost1 somehostwehanvenotseeninyears.example.com At the end I need to print out something like this: somehost1: 1234, 3456 somehost2: 1234 somehostwehavenotseeninyears: 1234 3456 Recommendations for a neophyte PHP'r? Thanks! Leam -------------- next part -------------- An HTML attachment was scrubbed... URL: From rolan at omnistep.com Tue Aug 25 15:33:12 2009 From: rolan at omnistep.com (Rolan Yang) Date: Tue, 25 Aug 2009 15:33:12 -0400 Subject: [nycphp-talk] Simple MySQL web based form creator? In-Reply-To: References: Message-ID: <4A943C78.9030804@omnistep.com> If your customer is using windows, check out MySQL-Front. ~Rolan Matt Juszczak wrote: > I have a single table, with about 20 fields, 2 enum's, etc. I'm > looking for a simple tool that can wrap a form around this table and > allow people to update/edit it. I feel phpmyadmin would work but it's > way too complex for this project. > > Any suggestions? > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From sequethin at gmail.com Tue Aug 25 15:40:08 2009 From: sequethin at gmail.com (Michael Hernandez) Date: Tue, 25 Aug 2009 15:40:08 -0400 Subject: [nycphp-talk] Input as array names In-Reply-To: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl> References: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl> Message-ID: <1251229208.6601.346.camel@mikeh-ubuntu> On Tue, 2009-08-25 at 15:27 -0400, Hall, Leam wrote: > Okay, here's one of the places I don't really get and can use some > help on. On my text processing script I'm going to slurp up host > names. They come in as the first, counting from 0, element. I can > explode and create the array, which gives me a string: > > $hostname[1] = somehost.example.com > > I can safely get rid of the ".example.com" bit, leaving $hostname[1] > as "somehost". What I need to understand is how to take $hostname[1] > and make it an array in it's own right so I can assign it a list of > numbers. > With variable variable names, if $hostname[1] = somehost $$hostname[1] = array(); now you have an array named $somehost --Mike H PS I didn't try it, don't hate me :) From cbaltatescu at greenvision.ro Tue Aug 25 16:09:52 2009 From: cbaltatescu at greenvision.ro (Cristian Baltatescu) Date: Tue, 25 Aug 2009 23:09:52 +0300 Subject: [nycphp-talk] Input as array names In-Reply-To: <1251229208.6601.346.camel@mikeh-ubuntu> References: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl> <1251229208.6601.346.camel@mikeh-ubuntu> Message-ID: <422973430908251309t5c284eb0q32bf880014a0f8b5@mail.gmail.com> On Tue, Aug 25, 2009 at 10:40 PM, Michael Hernandez wrote: > On Tue, 2009-08-25 at 15:27 -0400, Hall, Leam wrote: > > Okay, here's one of the places I don't really get and can use some > > help on. On my text processing script I'm going to slurp up host > > names. They come in as the first, counting from 0, element. I can > > explode and create the array, which gives me a string: > > > > $hostname[1] = somehost.example.com > > > > I can safely get rid of the ".example.com" bit, leaving $hostname[1] > > as "somehost". What I need to understand is how to take $hostname[1] > > and make it an array in it's own right so I can assign it a list of > > numbers. > > > With variable variable names, > > if $hostname[1] = somehost > > $$hostname[1] = array(); > > now you have an array named $somehost > > --Mike H > > PS I didn't try it, don't hate me :) > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > Or $hosts[$hostname[1]] = array($bugID1, $bugID2 ...) foreach( $hosts as $key=>$value){ echo "$key : ". implode(',' , $value); } -- Numai bine, Cristian -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.southwell at nyphp.com Tue Aug 25 16:15:49 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Tue, 25 Aug 2009 16:15:49 -0400 Subject: [nycphp-talk] how to resize images and maintain iptc data Message-ID: <4A944675.708@nyphp.com> I have a photography client who uploads images with iptc metadata. I need to pull out and store the iptc data (no problem), and resize the images (no problem) without losing the iptc data (problem). I can use a browser resize with the original image but I'd rather store resized images upon original upload if it's possible to do it without losing that data. Any ideas? -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From dcech at phpwerx.net Tue Aug 25 16:38:50 2009 From: dcech at phpwerx.net (Dan Cech) Date: Tue, 25 Aug 2009 16:38:50 -0400 Subject: [nycphp-talk] how to resize images and maintain iptc data In-Reply-To: <4A944675.708@nyphp.com> References: <4A944675.708@nyphp.com> Message-ID: <4A944BDA.5090704@phpwerx.net> Michael Southwell wrote: > I have a photography client who uploads images with iptc metadata. I > need to pull out and store the iptc data (no problem), and resize the > images (no problem) without losing the iptc data (problem). I can use a > browser resize with the original image but I'd rather store resized > images upon original upload if it's possible to do it without losing > that data. Any ideas? Any reason you couldn't use http://php.net/iptcembed to embed the data into the new resized image? Dan From jmcgraw1 at gmail.com Tue Aug 25 17:03:39 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Tue, 25 Aug 2009 17:03:39 -0400 Subject: [nycphp-talk] Time zone based on country/state/city In-Reply-To: References: <4A943020.6000002@nopersonal.info> Message-ID: On Tue, Aug 25, 2009 at 3:07 PM, Nelly Yusupova wrote: > Hello Everyone, > > Is there a way to figure out a time zone based on country/state/city. ?I > searched the web and could not find any resources. You have got two problems here: Most TZ databases are going to be LatLon specific, so, you'll have to convert an address (City, State, Country) to geolocation (latitude/longitude), Google and Yahoo have services for that. Then you'll have to convert the Lat Long to a timezone, using this: www.geonames.org/export http://www.geonames.org/export/web-services.html#timezone Hope that helps! - jake > > Thank you in advance. > > Sincerely, > Nelly Yusupova > Webgrrls.com > nelly at cgim.com > 917 603-9226 (phone) > URL: http://www.webgrrls.com > Blog: http://www.webgrrls.com/blog/ > Twitter: http://twitter.com/DigitalWoman > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From jmcgraw1 at gmail.com Tue Aug 25 17:05:05 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Tue, 25 Aug 2009 17:05:05 -0400 Subject: [nycphp-talk] Time zone based on country/state/city In-Reply-To: References: <4A943020.6000002@nopersonal.info> Message-ID: Also, you could just ask your users to supply their timezone... didn't think of that one! - jake On Tue, Aug 25, 2009 at 5:03 PM, Jake McGraw wrote: > On Tue, Aug 25, 2009 at 3:07 PM, Nelly Yusupova wrote: >> Hello Everyone, >> >> Is there a way to figure out a time zone based on country/state/city. ?I >> searched the web and could not find any resources. > > You have got two problems here: > > Most TZ databases are going to be LatLon specific, so, you'll have to > convert an address (City, State, Country) to geolocation > (latitude/longitude), Google and Yahoo have services for that. > > Then you'll have to convert the Lat Long to a timezone, using this: > > www.geonames.org/export > > http://www.geonames.org/export/web-services.html#timezone > > Hope that helps! > > - jake > >> >> Thank you in advance. >> >> Sincerely, >> Nelly Yusupova >> Webgrrls.com >> nelly at cgim.com >> 917 603-9226 (phone) >> URL: http://www.webgrrls.com >> Blog: http://www.webgrrls.com/blog/ >> Twitter: http://twitter.com/DigitalWoman >> >> >> >> _______________________________________________ >> 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 Tue Aug 25 17:23:49 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Tue, 25 Aug 2009 17:23:49 -0400 Subject: [nycphp-talk] how to resize images and maintain iptc data In-Reply-To: <4A944BDA.5090704@phpwerx.net> References: <4A944675.708@nyphp.com> <4A944BDA.5090704@phpwerx.net> Message-ID: <4A945665.70305@nyphp.com> Dan Cech wrote: > Michael Southwell wrote: >> I have a photography client who uploads images with iptc metadata. I >> need to pull out and store the iptc data (no problem), and resize the >> images (no problem) without losing the iptc data (problem). I can use a >> browser resize with the original image but I'd rather store resized >> images upon original upload if it's possible to do it without losing >> that data. Any ideas? > > Any reason you couldn't use http://php.net/iptcembed to embed the data > into the new resized image? uhh, nothing beyond ignorance ;-( though it does seem a bit clumsy to take it out, resize, and then put it back in. Thanks! -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From glenn310b at mac.com Tue Aug 25 18:13:24 2009 From: glenn310b at mac.com (Glenn Powell) Date: Tue, 25 Aug 2009 18:13:24 -0400 Subject: [nycphp-talk] Input as array names In-Reply-To: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl> References: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl> Message-ID: <22F6EE3D-DA73-4DA2-8D00-25DB20F35468@mac.com> Arrays are a powerful tool. Once you get the hang of it, you can do almost anything. Notice that some of them have named keys. Anyway, I remember when I first started using arrays, especially with named keys, and the world of possibilities that they opened up. So I thought I would share this... Hope it helps. (then find a good tutorial/book and use your imagination...) glenn $myarray[1][0] = 'somekey'; $myarray[1][] = '1234'; $myarray[1][] = '5678'; $myarray[1][] = '9101112'; print "example a\n"; print_r($myarray); print "example b\n"; print_r($myarray[1][1]); print "\n"; // or $myarray = array( 'somekey' => array() ); $myarray['somekey'][] = '1234'; $myarray['somekey'][] = '5678'; $myarray['somekey'][] = '910112'; print "example c\n"; print_r($myarray['somekey']); print "example d\n"; print_r($myarray['somekey'][1]); print "\n"; //or $myarray = array( 'somekey' => array( 'someotherkey' => array(), 'anotherkey' => array() ) ); $myarray['somekey']['someotherkey'][] = '1234'; $myarray['somekey']['someotherkey'][] = '5678'; $myarray['somekey']['someotherkey'][] = '910112'; $myarray['somekey']['anotherkey'][] = 'aaaa'; $myarray['somekey']['anotherkey'][] = 'bbbb'; $myarray['somekey']['anotherkey'][] = 'cccc'; print "example e\n"; print_r($myarray['somekey']); print "example f\n"; print_r($myarray['somekey']['someotherkey']); print "example g\n"; print_r($myarray['somekey']['anotherkey']); Output from the above code is; example a Array ( [1] => Array ( [0] => somekey [1] => 1234 [2] => 5678 [3] => 9101112 ) ) example b 1234 example c Array ( [0] => 1234 [1] => 5678 [2] => 910112 ) example d 5678 example e Array ( [someotherkey] => Array ( [0] => 1234 [1] => 5678 [2] => 910112 ) [anotherkey] => Array ( [0] => aaaa [1] => bbbb [2] => cccc ) ) example f Array ( [0] => 1234 [1] => 5678 [2] => 910112 ) example g Array ( [0] => aaaa [1] => bbbb [2] => cccc ) On Aug 25, 2009, at 3:27 PM, Hall, Leam wrote: > Okay, here's one of the places I don't really get and can use some > help on. On my text processing script I'm going to slurp up host > names. They come in as the first, counting from 0, element. I can > explode and create the array, which gives me a string: > > $hostname[1] = somehost.example.com > > I can safely get rid of the ".example.com" bit, leaving $hostname[1] > as "somehost". What I need to understand is how to take $hostname[1] > and make it an array in it's own right so I can assign it a list of > numbers. > > For example, my text file looks something like this: > > Bug ID: 1234 > Affected Machines: > somehost1 > somehost2.example.com > somehostwehavenotseeninyears.example.com > > Bug ID: 3456 > Affected Machines: > somehost1 > somehostwehanvenotseeninyears.example.com > > At the end I need to print out something like this: > > somehost1: 1234, 3456 > somehost2: 1234 > somehostwehavenotseeninyears: 1234 3456 > > Recommendations for a neophyte PHP'r? > > Thanks! > > Leam > _______________________________________________ > 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 ka at kacomputerconsulting.com Tue Aug 25 19:55:04 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Tue, 25 Aug 2009 16:55:04 -0700 Subject: [nycphp-talk] Advice on setting for testing server Message-ID: <1251244504.28166@coral.he.net> Hi, sorry if this was covered anywhere previously in this thread, but I've found it useful, in addition to enabling the full error reporting that's built into PHP, to also add customized error_log calls anywhere where you have such things as database inserts/updates, web service request/response or other behind-the-scenes text generation or processing, or any other areas of the application which you feel are extremely performance intensive, bug-prone or hard to monitor using more generic error messages. Set it up so that you can toggle this function on/off in one place before turnover to production, so that you can leave in all your calls to error_log for future use. Your error_log file on the server will quickly grow to enormous proportions, but since it's only a test server, it won't be a worry! By doing this you can build a history of the application's behavior and performance and verify that everything is exactly as it should be. Right now I'm working with the Paypal IPN code and I'm finding that it's quite a creative experience to figure out what, in any particular instance, is the highest level of valuable information you can wreak out of some code by dint of the old error_log function...I'd love to see some error handling examples from people on this list which are undoubtedly leaps and bounds above what I've got going on here...!! Kristina > Ajai Khattri wrote: > >> Do any of you have recommendations on configuration settings to use? > > > > Most of these packages come with pretty sensible config settings so I > > probably would *not* mess with them without knowing the consequences. > > Duly noted. > > >> Which packages/extensions/modules should be installed/enabled? > > > > That kind of depends on what software you're writing dont you think? > > Ah, right--thinking. Sometimes I forget to do that. Yes, that would be a > sensible thing to consider. :-) > > >Some > > frameworks will need additional extensions and tweaks to Apache so there > > is no simple fits-all rule. The other thing to consider is that any > > changes you make should be easy to maintain and put back after a software > > update. (In the case of Apache I tend to leave the main config alone since > > any changes will likely be overwritten when the software is updated). IIRC > > Ubuntu has something like a sites-enabled/sites-available folder where you > > can put vhost files (one per vhost is good practice). I usually create a > > file called ALL that contains any global config tweaks. > > > >> Should I go ahead and turn off error reporting and enable it via my > >> scripts, or should I leave it on all the time? If I should leave it on, > >> at what level should I set it? E_ALL? > > > > If you're using a framework it might already do all that for you and maybe > > provide its own config file for you to tweak that in. > > I'll look into all that, thanks. > > > Firebug is good on the browser side (also look at the Web Developer > > Toolbar and the YSlow extension for Firebug). On the server side look at > > FirePHP and Xdebug extensions for PHP. > > > > Firebug, YSlow, and the Web Developer Toolbar have been my best friends > for front-end work for quite some time. I've seen the FirePHP & Xdebug > extensions but didn't really understand how to use them, so I just > ignored them. Now that you've mentioned them I'll go back and give them > a closer look. > > > All developers should be using version control. Subversion is very popular > > but Git is also becoming so these days. > > Understood. > > Bev > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From danielc at analysisandsolutions.com Tue Aug 25 23:16:27 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 25 Aug 2009 23:16:27 -0400 Subject: [nycphp-talk] Input as array names In-Reply-To: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl> References: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl> Message-ID: <20090826031626.GA3489@panix.com> On Tue, Aug 25, 2009 at 03:27:51PM -0400, Hall, Leam wrote: > > Bug ID: 1234 > Affected Machines: > somehost1 > somehost2.example.com > somehostwehavenotseeninyears.example.com > > Bug ID: 3456 > Affected Machines: > somehost1 > somehostwehanvenotseeninyears.example.com All in pseudo code, because I'm not doing your work for you. // Populate the array.. $hosts = array(); foreach (line in file) { // Put code to grab bug numbers up here... // Once you get to the host name lines... $hosts[$name][] = $bug_id; } Now you'll have an array like this: $hosts = array( 1234 => array( 'somehost1', 'somehost2.example.com', 'somehostwehanvenotseeninyears.example.com', ), 3456 => array( 'somehost1', 'somehostwehanvenotseeninyears.example.com', ), ); Finally, you can loop over $hosts and implode, as per someone else's posting upstream in this thread. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From ajai at bitblit.net Wed Aug 26 00:29:47 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 26 Aug 2009 00:29:47 -0400 (EDT) Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A94319D.2080802@nopersonal.info> Message-ID: On Tue, 25 Aug 2009, lists at nopersonal.info wrote: > Chris Snyder wrote: > > It's a good idea to set up a wiki for your personal use as a sysadmin, > > to store recipes like this, and make them easy to update with each new > > install. The only thing worse than spending hours getting a > > configuration exactly right is realizing two years later that you > > didn't paste-and-save it anywhere. > > I've been meaning to do that for the longest time for browser bugs & > such. As a matter of fact, I even set up a a couple of wikis at one > point and then abandoned them because I didn't care for the way they > worked. > > I guess now would be the optimal time to start over as I'll likely be > tripping myself up quite a bit during the learning process. > > Do you have any recommendations on a good one to use? Of course server scripts and configs should also be in a version control system. I use svnrepository.com (I think its $8/month for unlimited projects up to a couple Gb). You can set up a repo for each project but more importantly you can also click and create a Trac instance for each project. Trac of course has a wiki, source browsr and ticket system. Even though for some projects Im the only user, its great to click and document stuff as you go using the wiki, or even open tickets to yourself to remind you to fix something. Ive thought about switching to Git but I haven't found something similar that is better value for money ($8/month buys me peace of mind :-). -- Aj. From ajai at bitblit.net Wed Aug 26 00:35:51 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 26 Aug 2009 00:35:51 -0400 (EDT) Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <1251244504.28166@coral.he.net> Message-ID: On Tue, 25 Aug 2009, Kristina D. H. Anderson wrote: > Right now I'm working with the Paypal IPN code and I'm finding that > it's quite a creative experience to figure out what, in any particular > instance, is the highest level of valuable information you can wreak > out of some code by dint of the old error_log function...I'd love to > see some error handling examples from people on this list which are > undoubtedly leaps and bounds above what I've got going on here...!! If you're using a framework, they often already have excellent error logging and stack tracing. Also I think FirePHP integrates with pretty much all of the major frameworks now so that's a good option. XDebug is worth checking out too. -- Aj. From ajai at bitblit.net Wed Aug 26 00:39:31 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 26 Aug 2009 00:39:31 -0400 (EDT) Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A94319D.2080802@nopersonal.info> Message-ID: On Tue, 25 Aug 2009, lists at nopersonal.info wrote: > Do you have any recommendations on a good one to use? If your VCS of choice doesn't have a wiki, you might want to look at pbworks.com. (Sure, I could grab some open source and install it on my own hardware but not having to waste time or worry about maintaining a server allows me to focus more of my energy on the current project). -- Aj. From ajai at bitblit.net Wed Aug 26 00:51:50 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 26 Aug 2009 00:51:50 -0400 (EDT) Subject: [nycphp-talk] Working with designers In-Reply-To: <4A90C6DD.90300@nopersonal.info> Message-ID: On Sun, 23 Aug 2009, lists at nopersonal.info wrote: > Last but not least, designers & developers need to respect each other's > professional expertise. I've met designers who are contemptuous of > coders & developers, seeing them as little more ill-tempered, geeky > "code monkeys" whose sole sense of taste lies in their mouths. Likewise, > I've met coders & developers who view designers as spoiled, > temperamental artistic types who deal in "make it pretty" fluff that > lacks any real importance. Sometimes both are true, but most of the time > not. Good design, like good web development, comes from years of > hard-won experience and dedication to craft. My experience has been that often designers dont think of developer's as creative peers. Its a different kind of creativity and its not just laying code in a pre-determined order - there are often many ways to accomplish the same functionality. Coming up with an elegant and maintainable architecture is also very important. -- Aj. From leam at reuel.net Wed Aug 26 05:43:43 2009 From: leam at reuel.net (Leam Hall) Date: Wed, 26 Aug 2009 05:43:43 -0400 Subject: [nycphp-talk] Advice on OOP & Frameworks In-Reply-To: <330532b60908250809w3bac32e4h22320ec96d56030@mail.gmail.com> References: <4A90F358.3010405@nopersonal.info> <4A912A3D.2030005@reuel.net> <4A93F263.3020200@nopersonal.info> <330532b60908250809w3bac32e4h22320ec96d56030@mail.gmail.com> Message-ID: <4A9503CF.9020408@reuel.net> Talk about timing! I got a request for expertise from LinkedIn and the payback for the survey included an Amazon gift certificate! Seems like an easy win here. ;) Leam Mitch Pirtle wrote: > Ok, now I gotta pimp a book. Pragmatic Thinking and Learning, by > Pragmatic Publishers: > > http://www.pragprog.com/titles/ahptl/pragmatic-thinking-and-learning > > They mention the Dreyfus model of competence levels, which is an > awesome read in itself. I encourage everyone to read this book, it > will certainly change the way you think, the way you assess your own > skills, and evaluate others. > > I'd consider that an awesome start. > > -- Mitch > From leam at reuel.net Wed Aug 26 05:58:58 2009 From: leam at reuel.net (Leam Hall) Date: Wed, 26 Aug 2009 05:58:58 -0400 Subject: [nycphp-talk] OOP, Frameworks, ONLAMP, and NYPHP Message-ID: <4A950762.6050000@reuel.net> More timing...or synchronicity... As we discuss the learning path and stages, I've heard that ONLAMP will not really continue. I mentioned ONLAMP's aged articles to you a few months ago and was all hyped about upgrade and reform. ONLAMP has helped me in several ways and it's nice to have links to go back to as I try to understand sub-topics. NYPHP has PHundamentals. Not as extensive as ONLAMP, but with more growth potential. Also, I will note that not only do I not live in or near the City but yesterday I pointed a PHP newbie to this list as a great resource. If you want somewhere culturally and economically, if not geographically, distant from NYC, come on down to SW Ga for a visit! So the question on personal growth seems to have an option of expanding the NYPHP sphere of influence. With ONLAMP receding is this a good time to grow the PHundamentals and NYPHP? Or are there other places and portals to fill ONLAMP's shoes? Leam From lhall at smartronix.com Wed Aug 26 08:39:53 2009 From: lhall at smartronix.com (Hall, Leam) Date: Wed, 26 Aug 2009 08:39:53 -0400 Subject: [nycphp-talk] Input as array names In-Reply-To: <22F6EE3D-DA73-4DA2-8D00-25DB20F35468@mac.com> References: <80BACF7E-9FD0-4E3D-8130-C6A6C0530D02@mimectl>, <22F6EE3D-DA73-4DA2-8D00-25DB20F35468@mac.com> Message-ID: Glenn and Dan, thanks! I think those are the mental tools I needed. Off to code! Leam -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Wed Aug 26 11:12:42 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 26 Aug 2009 11:12:42 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: References: <4A94319D.2080802@nopersonal.info> Message-ID: <20090826151242.GA8163@panix.com> Hey Ajai: On Wed, Aug 26, 2009 at 12:29:47AM -0400, Ajai Khattri wrote: > > I use svnrepository.com (I think its $8/month for unlimited > projects up to a couple Gb). ... > Ive thought about switching to Git but I haven't found something similar > that is better value for money Are you too big for the Micro or Small plans at http://github.com/plans ? > ($8/month buys me peace of mind :-). And that piece of mind comes because they allow you to download a full "svnadmin hotcopy" backup of the repository so when svnrepository.com goes out of business you're not SOL, right? --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at nopersonal.info Wed Aug 26 13:59:36 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Wed, 26 Aug 2009 13:59:36 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: Message-ID: <4A957808.6030704@nopersonal.info> Ajai Khattri wrote: > My experience has been that often designers dont think of developer's as > creative peers. Its a different kind of creativity and its not just laying > code in a pre-determined order - there are often many ways to accomplish > the same functionality. Coming up with an elegant and maintainable > architecture is also very important. I agree 100%. For many designers--at least the ones I have met--any kind of coding or programming is anathema. They see it as something dry & tedious, restrictive, confusing, and totally alien in its intangibility. I suppose that's partly because designers' creativity is by nature visually oriented, whereas programming requires more of a... I'm not sure what to call it... maybe creativity of logic? Both disciplines have sets of rules, and the most creative in both camps know how to break them in a way that leads to something new & better. It's too bad that there's often so much misunderstanding and friction between the two--it's sort of like beauty of form vs. beauty of function. IMO, the best applications embody both by being so elegantly designed (both visually & functionally) that they are nearly invisible--i.e. they allow the end user to perform tasks without having to spend a bunch of time trying to figure out how things work. Bev From ajai at bitblit.net Wed Aug 26 14:52:07 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Wed, 26 Aug 2009 14:52:07 -0400 (EDT) Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <20090826151242.GA8163@panix.com> Message-ID: On Wed, 26 Aug 2009, Daniel Convissor wrote: > > Ive thought about switching to Git but I haven't found something similar > > that is better value for money > > Are you too big for the Micro or Small plans at http://github.com/plans ? Actually I see now that svnrepository.com have a new control panel at sourcerepo.com that offers svn, git and Mercurial so I guess I can just switch to Git when Im ready. > > ($8/month buys me peace of mind :-). > > And that piece of mind comes because they allow you to download a full > "svnadmin hotcopy" backup of the repository so when svnrepository.com > goes out of business you're not SOL, right? All of the normal svn and Trac commands are available. -- Aj. From danielc at analysisandsolutions.com Wed Aug 26 14:58:34 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 26 Aug 2009 14:58:34 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <4A957808.6030704@nopersonal.info> References: <4A957808.6030704@nopersonal.info> Message-ID: <20090826185834.GA23861@panix.com> Hi Bev: On Wed, Aug 26, 2009 at 01:59:36PM -0400, lists at nopersonal.info wrote: > whereas programming requires more of a... I'm not > sure what to call it... maybe creativity of logic? That's exactly how I feel about programming and is why I love my job. > it's sort of like beauty of form vs. beauty of > function. IMO, the best applications embody both So true. Bev, you've said may insightful things in an elegant way. Who ARE you? You're interacting in a public forum, it's kind of tacky to pretty much hide your identity. Yeah, spam sucks. Alas. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at nopersonal.info Wed Aug 26 15:05:15 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Wed, 26 Aug 2009 15:05:15 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: <4A8D52FE.6070200@gmx.com> <4A90C6DD.90300@nopersonal.info> <58f08dcf0908230731s33e8d5f9sdfcc82490530c92c@mail.gmail.com> <4A93EBF3.1090306@nopersonal.info> Message-ID: <4A95876B.8020901@nopersonal.info> tedd wrote: > Me too -- I'm a one man band combining graphic design, html, css, > javascript ajax, php and mysql all rolled into one while observing best > practices, unobtrusive and semantic code, and addressing W3C compliance > and accessibility issues. > > In other words, there's a lot to know to get it right. I can see how the > division of responsibility can become blurred in a team environment > while working on large projects. Fortunately for me, my projects don't > normally exceed $20k and that appears to be a nice cut-off for me. > > In my experience, projects that are larger can go to a team, those > smaller can be handled by one person. Good for you for being able to do it all! There is indeed a lot to know to get it right. I don't usually think about it until someone walks into a forum and says, "I want to do web design. What steps do I need to take?" the first thing I tell them is that they need to be insatiably curious, love learning new things, make Google their best friend, and learn how to ask questions the right way. That is IF they even have enough sense to ask. Most times it's more like a demand: "I need to do X, Y and Z by the end of the month, but I have neither the time nor the desire to learn anything technical. Tell me how to accomplish this ASAP!" Umm...sorry, my magic wand is in the repair shop, so I'm afraid I can't help you. Bev From lists at nopersonal.info Wed Aug 26 15:26:09 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Wed, 26 Aug 2009 15:26:09 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <20090826185834.GA23861@panix.com> References: <4A957808.6030704@nopersonal.info> <20090826185834.GA23861@panix.com> Message-ID: <4A958C51.9030504@nopersonal.info> Daniel Convissor wrote: > Bev, you've said may insightful things in an elegant way. Who ARE you? Thanks for the compliment, Daniel. I introduced myself and gave some of my background back when I first joined the list. > You're interacting in a public forum, it's kind of tacky to pretty much > hide your identity. Yeah, spam sucks. Alas. *blinks* Huh? The nopersonal.info domain is registered to me (albeit privately), and the email address I use for this forum it a real one. Anyone who wants to contact me directly is more than welcome to do so any time. Bev is my given name, although I do have a Muslim name that I usually go by (I converted 18 years ago). I haven't provided my last name, phone number, or the name of the company I work for, but that's because this list is indexed by search engines and I don't want that info floating around out there. What else? I don't go to the monthly meetings because the NJT train station by my apartment is a local stop and the trains tend to run few & far between, making it impractical for me to attend in terms of the travel time required. I'll be attending the CodeWorks conference in October and am hoping that I'll get a chance to meet some of you there. Does that help a little? Bev From lists at nopersonal.info Wed Aug 26 15:36:03 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Wed, 26 Aug 2009 15:36:03 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <68de37340908251154r781bdae5q9fb197d5e1c62254@mail.gmail.com> References: <4A910DB0.5040204@nopersonal.info> <4A94247F.9010500@umn.edu> <4A94319D.2080802@nopersonal.info> <68de37340908251154r781bdae5q9fb197d5e1c62254@mail.gmail.com> Message-ID: <4A958EA3.4000503@nopersonal.info> Eddie Drapkin wrote: > I maintain a wiki that other people have to use, so I use MediaWiki, > because it's pretty unlikely that there's anyone I'm likely to work > with that is unfamiliar with the layout and features it offers, > because of wikipedia's prevalance. It's relatively easy to install > and hack at, so I'd recommend it. Yeah, that's one of the ones I installed before, but since it's just me working on the web design & webdev projects, it seemed like overkill. Thanks for taking the time to respond though. Yesterday I found a knowledge base script that I think might work for me, so I'm going to install it and try it out for a week or two. Bev From lists at nopersonal.info Wed Aug 26 15:38:33 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Wed, 26 Aug 2009 15:38:33 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: References: Message-ID: <4A958F39.10803@nopersonal.info> Ajai Khattri wrote: > Of course server scripts and configs should also be in a version control > system. I use svnrepository.com (I think its $8/month for unlimited > projects up to a couple Gb). You can set up a repo for each project but > more importantly you can also click and create a Trac instance for each > project. Trac of course has a wiki, source browsr and ticket system. Even > though for some projects Im the only user, its great to click and document > stuff as you go using the wiki, or even open tickets to yourself to remind > you to fix something. This is a good option to be aware of. Thanks, Ajai. Bev From lists at nopersonal.info Wed Aug 26 15:43:11 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Wed, 26 Aug 2009 15:43:11 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: References: Message-ID: <4A95904F.4070207@nopersonal.info> Ajai Khattri wrote: > If your VCS of choice doesn't have a wiki, you might want to look at > pbworks.com. > > (Sure, I could grab some open source and install it on my own hardware but > not having to waste time or worry about maintaining a server allows me to > focus more of my energy on the current project). I actually like the part of maintaining a server, especially now because I still have so much to learn in that area. I'll definitely bookmark pbworks.com though. Thanks, Bev From lists at nopersonal.info Wed Aug 26 15:58:44 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Wed, 26 Aug 2009 15:58:44 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <1251244504.28166@coral.he.net> References: <1251244504.28166@coral.he.net> Message-ID: <4A9593F4.5090505@nopersonal.info> Kristina D. H. Anderson wrote: > Hi, sorry if this was covered anywhere previously in this thread, but > I've found it useful, in addition to enabling the full error reporting > that's built into PHP, to also add customized error_log calls anywhere > where you have such things as database inserts/updates, web service > request/response or other behind-the-scenes text generation or > processing, or any other areas of the application which you feel are > extremely performance intensive, bug-prone or hard to monitor using > more generic error messages. > > Set it up so that you can toggle this function on/off in one place > before turnover to production, so that you can leave in all your calls > to error_log for future use. > > Your error_log file on the server will quickly grow to enormous > proportions, but since it's only a test server, it won't be a worry! > By doing this you can build a history of the application's behavior and > performance and verify that everything is exactly as it should be. > > Right now I'm working with the Paypal IPN code and I'm finding that > it's quite a creative experience to figure out what, in any particular > instance, is the highest level of valuable information you can wreak > out of some code by dint of the old error_log function... Hi, Kristina. Thanks for chiming in with additional great advice! I need to organize the info everyone has provided this week so that I can form a game plan going forward. I have no doubt all these tips will prove invaluable in improving my productivity. Bev From ka at kacomputerconsulting.com Wed Aug 26 16:34:20 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Wed, 26 Aug 2009 13:34:20 -0700 Subject: [nycphp-talk] Advice on setting for testing server Message-ID: <1251318860.30499@coral.he.net> Hi Bev, Another good tip someone gave me is to train yourself to automatically back up any file by adding the date in format _20090826 to the filename before you edit or overwrite it, and that way you can always roll back your files and have a day by day history of the code. Again like with your log file, it will grow and soon you will have 16 different copies of each active file on your test server. But it's simple, free and most importantly EASY TO INSTALL :) And in terms of tracking "to do" items, I just keep a text file in each active project in which I keep detailed notes and to do punchlists and etc. I lack patience for stuff that is needlessly complex as I've always been a "brute force by text editor" type of programmer. I just try to follow the "KISS" method, and avoid as many hazards as possible. And I would certainly hesitate to hold myself out as a "productivity guru" -- I tend to work in fits and starts and be insanely productive some days, and then other days it just isn't really working for me so much... Love Ajai's suggestion for XDebug but fear the installation documentation may be my undoing! :) Kristina >Bev wrote: > > Hi, Kristina. Thanks for chiming in with additional great advice! > > I need to organize the info everyone has provided this week so that I > can form a game plan going forward. I have no doubt all these tips will > prove invaluable in improving my productivity. > > Bev > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From ka at kacomputerconsulting.com Wed Aug 26 16:34:20 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Wed, 26 Aug 2009 13:34:20 -0700 Subject: [nycphp-talk] Advice on setting for testing server Message-ID: <1251318860.30499@coral.he.net> Hi Bev, Another good tip someone gave me is to train yourself to automatically back up any file by adding the date in format _20090826 to the filename before you edit or overwrite it, and that way you can always roll back your files and have a day by day history of the code. Again like with your log file, it will grow and soon you will have 16 different copies of each active file on your test server. But it's simple, free and most importantly EASY TO INSTALL :) And in terms of tracking "to do" items, I just keep a text file in each active project in which I keep detailed notes and to do punchlists and etc. I lack patience for stuff that is needlessly complex as I've always been a "brute force by text editor" type of programmer. I just try to follow the "KISS" method, and avoid as many hazards as possible. And I would certainly hesitate to hold myself out as a "productivity guru" -- I tend to work in fits and starts and be insanely productive some days, and then other days it just isn't really working for me so much... Love Ajai's suggestion for XDebug but fear the installation documentation may be my undoing! :) Kristina >Bev wrote: > > Hi, Kristina. Thanks for chiming in with additional great advice! > > I need to organize the info everyone has provided this week so that I > can form a game plan going forward. I have no doubt all these tips will > prove invaluable in improving my productivity. > > Bev > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From danielc at analysisandsolutions.com Wed Aug 26 18:20:01 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 26 Aug 2009 18:20:01 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <4A958C51.9030504@nopersonal.info> References: <4A957808.6030704@nopersonal.info> <20090826185834.GA23861@panix.com> <4A958C51.9030504@nopersonal.info> Message-ID: <20090826222001.GA7384@panix.com> Hi Bev: On Wed, Aug 26, 2009 at 03:26:09PM -0400, lists at nopersonal.info wrote: > > *blinks* Huh? The nopersonal.info domain is registered to me (albeit > privately), and the email address I use for this forum it a real one. Well, I'll be darned. I just assumed it was made up because it sounds obfuscatory. Thanks for the correction. > Bev is my given name, although I do have a Muslim name that I usually go > by (I converted 18 years ago). Ramadan mubarak. > What else? I don't go to the monthly meetings because the NJT train > station by my apartment is a local stop and the trains tend to run few & > far between Alas. Hopefully we'll meet up sooner or later. See you, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From brian at realm3.com Wed Aug 26 18:22:12 2009 From: brian at realm3.com (Brian Dailey) Date: Wed, 26 Aug 2009 17:22:12 -0500 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <1251318860.30499@coral.he.net> References: <1251318860.30499@coral.he.net> Message-ID: <4A95B594.9090406@realm3.com> Kristina D. H. Anderson wrote: > Hi Bev, > > Another good tip someone gave me is to train yourself to automatically > back up any file by adding the date in format _20090826 to the filename > before you edit or overwrite it, and that way you can always roll back > your files and have a day by day history of the code. Or you can use git. It's easier, and much, much cleaner. -- realm3 web applications, LLC realm3.com/ twitter.com/brian_dailey/ p: 917-512-3594 f: 440-744-3559 From chsnyder at gmail.com Wed Aug 26 18:35:00 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Wed, 26 Aug 2009 18:35:00 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A95B594.9090406@realm3.com> References: <1251318860.30499@coral.he.net> <4A95B594.9090406@realm3.com> Message-ID: On Wed, Aug 26, 2009 at 6:22 PM, Brian Dailey wrote: > > > Kristina D. H. Anderson wrote: >> >> Hi Bev, >> >> Another good tip someone gave me is to train yourself to automatically >> back up any file by adding the date in format _20090826 to the filename >> before you edit or overwrite it, and that way you can always roll back your >> files and have a day by day history of the code. > > Or you can use git. It's easier, and much, much cleaner. Wow, we could write a unix tips book from this thread. I started using git to track changes to DNS zone files a few months ago, and it works great. Chris Snyder http://chxor.chxo.com/ From ka at kacomputerconsulting.com Wed Aug 26 18:41:51 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Wed, 26 Aug 2009 15:41:51 -0700 Subject: [nycphp-talk] Advice on setting for testing server Message-ID: <1251326511.24629@coral.he.net> Keep those Unix tips coming...don't be really shocked if you get questions from me in a few days about how to install this stuff, though. Kristina > On Wed, Aug 26, 2009 at 6:22 PM, Brian Dailey wrote: > > > > > > Kristina D. H. Anderson wrote: > >> > >> Hi Bev, > >> > >> Another good tip someone gave me is to train yourself to automatically > >> back up any file by adding the date in format _20090826 to the filename > >> before you edit or overwrite it, and that way you can always roll back your > >> files and have a day by day history of the code. > > > > Or you can use git. It's easier, and much, much cleaner. > > Wow, we could write a unix tips book from this thread. > > I started using git to track changes to DNS zone files a few months > ago, and it works great. > > Chris Snyder > http://chxor.chxo.com/ > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From ka at kacomputerconsulting.com Wed Aug 26 18:41:51 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Wed, 26 Aug 2009 15:41:51 -0700 Subject: [nycphp-talk] Advice on setting for testing server Message-ID: <1251326511.24629@coral.he.net> Keep those Unix tips coming...don't be really shocked if you get questions from me in a few days about how to install this stuff, though. Kristina > On Wed, Aug 26, 2009 at 6:22 PM, Brian Dailey wrote: > > > > > > Kristina D. H. Anderson wrote: > >> > >> Hi Bev, > >> > >> Another good tip someone gave me is to train yourself to automatically > >> back up any file by adding the date in format _20090826 to the filename > >> before you edit or overwrite it, and that way you can always roll back your > >> files and have a day by day history of the code. > > > > Or you can use git. It's easier, and much, much cleaner. > > Wow, we could write a unix tips book from this thread. > > I started using git to track changes to DNS zone files a few months > ago, and it works great. > > Chris Snyder > http://chxor.chxo.com/ > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From lists at nopersonal.info Thu Aug 27 03:14:45 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Thu, 27 Aug 2009 03:14:45 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <20090826222001.GA7384@panix.com> References: <4A957808.6030704@nopersonal.info> <20090826185834.GA23861@panix.com> <4A958C51.9030504@nopersonal.info> <20090826222001.GA7384@panix.com> Message-ID: <4A963265.5040207@nopersonal.info> Daniel Convissor wrote: > Well, I'll be darned. I just assumed it was made up because it sounds > obfuscatory. Thanks for the correction. Well it is intended to be obfuscatory, just not in the way you thought. :-) > Ramadan mubarak. Thanks! > Alas. Hopefully we'll meet up sooner or later. I'm looking forward to it. Take care, Bev From randalrust at gmail.com Thu Aug 27 10:04:18 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 27 Aug 2009 10:04:18 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text Message-ID: In one of our applications, we have a need to apply inline links to the text, and would like to figure out a way to do this dynamically. I have looked for this high and low, but haven't been able to find what I am looking for. Perhaps I am searching the wrong keywords. What we have is a repository of 1,000 articles. Each article has a unique title. If the title of that article appears in another article, we want to apply a link to the text, but only the first instance of the text. My thought is that we have to: 1. create an array of all titles 2. create a variable that holds the article text 3. loop through the title array and search the article text for a match 4. the first instance that a match is found, append the link and update the string variable The trick is that when a new article is added, they system needs to automatically go back to all of the existing articles and run through this process, which I don't like, because this won't be 100% accurate in the editor's eyes. each updated article needs to be reviewed. I also think it would cause a performance hit and dramatically slow down the system, especially in one installation where we have nearly 4,000 record that would need to be updated. Personally, it seems to me that JavaScript is a better solution here, and to simply append those links when the page loads. Unfortunately, these sites all have to comply with Section 508 and other accessibility guidelines, so that might not be an acceptable solution. Any suggestions? -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From chuck.reeves at gmail.com Thu Aug 27 10:17:15 2009 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Thu, 27 Aug 2009 10:17:15 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: Message-ID: I think the best way to tackle this would be look for titles of articles when you posting a new article and just update the text when the editor is going to save the article. Since you can store the title of articles as a field in your database, you can then go and quickly find if the article contains the title and just do a simple replace. Using JS is not going to work to your advantage since the dosent need to be dynamic all the time (that can also lead to bugs). Just update the article at the time of saving saves processes in the long run and prevents cross browser issues that can come up in JS. On Thu, Aug 27, 2009 at 10:04 AM, Randal Rust wrote: > In one of our applications, we have a need to apply inline links to > the text, and would like to figure out a way to do this dynamically. I > have looked for this high and low, but haven't been able to find what > I am looking for. Perhaps I am searching the wrong keywords. > > What we have is a repository of 1,000 articles. Each article has a > unique title. If the title of that article appears in another article, > we want to apply a link to the text, but only the first instance of > the text. > > My thought is that we have to: > > 1. create an array of all titles > 2. create a variable that holds the article text > 3. loop through the title array and search the article text for a match > 4. the first instance that a match is found, append the link and > update the string variable > > The trick is that when a new article is added, they system needs to > automatically go back to all of the existing articles and run through > this process, which I don't like, because this won't be 100% accurate > in the editor's eyes. each updated article needs to be reviewed. I > also think it would cause a performance hit and dramatically slow down > the system, especially in one installation where we have nearly 4,000 > record that would need to be updated. > > Personally, it seems to me that JavaScript is a better solution here, > and to simply append those links when the page loads. Unfortunately, > these sites all have to comply with Section 508 and other > accessibility guidelines, so that might not be an acceptable solution. > > Any suggestions? > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > 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 paul at devonianfarm.com Thu Aug 27 10:38:51 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Thu, 27 Aug 2009 10:38:51 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: Message-ID: <4A969A7B.7030508@devonianfarm.com> Randal Rust wrote: > The trick is that when a new article is added, they system needs to > automatically go back to all of the existing articles and run through > this process, which I don't like, because this won't be 100% accurate > in the editor's eyes. each updated article needs to be reviewed. I > also think it would cause a performance hit and dramatically slow down > the system, especially in one installation where we have nearly 4,000 > record that would need to be updated. > That shouldn't be a problem. I just a ran a script that updated 40,000 records (doing something of similar complexity) that completed in about 10 seconds. If it was 4 million records, then I might worry a little about performance. If reviewing by editors is important, you can do this as a workflow system. There's a couple ways to do it, but basically you scan through the database looking for records that your system would like to update: rather than updating the actual records, you insert a row into a table that indicates that this item should be reviewed: the table could have a column that holds the new text. Then you write a script that shows the editor the first article that could be changed: the editor then has the option to (i) accept the change, (ii) edit the text, or (iii) not accept the change. Currently I'm working on a system where documents get changed by automatic processes, contractors, employees, and web users. There's quite a lot of thinking of the above sort in there. From tedd at sperling.com Thu Aug 27 10:43:26 2009 From: tedd at sperling.com (tedd) Date: Thu, 27 Aug 2009 10:43:26 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <4A95876B.8020901@nopersonal.info> References: <4A8D52FE.6070200@gmx.com> <4A90C6DD.90300@nopersonal.info> <58f08dcf0908230731s33e8d5f9sdfcc82490530c92c@mail.gmail.com> <4A93EBF3.1090306@nopersonal.info> <4A95876B.8020901@nopersonal.info> Message-ID: At 3:05 PM -0400 8/26/09, lists at nopersonal.info wrote: >That is IF they even have enough sense to ask. Most times it's more like >a demand: "I need to do X, Y and Z by the end of the month, but I have >neither the time nor the desire to learn anything technical. Tell me how >to accomplish this ASAP!" Umm...sorry, my magic wand is in the repair >shop, so I'm afraid I can't help you. > >Bev Bev: I know what you mean. For me, clients basically fall into two groups: a) Those who tell me what they want; b) And those who tell me how to do what they want. I work well with (a), but have problems with (b). When it comes to teaching (I do teach at college level), there are very few students/clients who fully realize all that's involved in developing a web site. Many think, as I've been told "It's easy -- my son learned HTML in high school" while they are totally clueless. The most problematic students/clients are the ones who have some experience with HTML and think that's all there is. Here's a couple of links that I often tell clients to review: http://sperling.com/web-developer.php http://sperling.com/four-things-clients-should-know.php Furthermore, the number of actual web developers out there who do know how to program in all the web languages (i.e., namely html, css, javascript, php, mysql, et al) to create a truly functional web site, are very few. And lastly, none of this is static. I spend time every day learning something new -- the web is constantly changing and keeping up with it is a daily challenge. I was quoted a long time ago as saying: "I've learned something new every day of my life -- and I'm getting damned tried of it." And that hasn't changed much. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From glenn310b at mac.com Thu Aug 27 11:40:12 2009 From: glenn310b at mac.com (Glenn Powell) Date: Thu, 27 Aug 2009 11:40:12 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: Message-ID: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> Maybe altering the existing articles is a one time process? Just once to add the links, based on a hash of known article titles to date. For future articles; I don't see how a pre-existing article could have made reference to an article title that hasn't been published yet. That would mean that only new articles would need to be run through the process at the time of publication? and update the known article titles with the new one. Of course, I probably don't fully understand the challenge... Glenn On Aug 27, 2009, at 10:04 AM, Randal Rust wrote: > In one of our applications, we have a need to apply inline links to > the text, and would like to figure out a way to do this dynamically. I > have looked for this high and low, but haven't been able to find what > I am looking for. Perhaps I am searching the wrong keywords. > > What we have is a repository of 1,000 articles. Each article has a > unique title. If the title of that article appears in another article, > we want to apply a link to the text, but only the first instance of > the text. > > My thought is that we have to: > > 1. create an array of all titles > 2. create a variable that holds the article text > 3. loop through the title array and search the article text for a > match > 4. the first instance that a match is found, append the link and > update the string variable > > The trick is that when a new article is added, they system needs to > automatically go back to all of the existing articles and run through > this process, which I don't like, because this won't be 100% accurate > in the editor's eyes. each updated article needs to be reviewed. I > also think it would cause a performance hit and dramatically slow down > the system, especially in one installation where we have nearly 4,000 > record that would need to be updated. > > Personally, it seems to me that JavaScript is a better solution here, > and to simply append those links when the page loads. Unfortunately, > these sites all have to comply with Section 508 and other > accessibility guidelines, so that might not be an acceptable solution. > > Any suggestions? > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From randalrust at gmail.com Thu Aug 27 14:37:10 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 27 Aug 2009 14:37:10 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> Message-ID: On Thu, Aug 27, 2009 at 11:40 AM, Glenn Powell wrote: > Maybe altering the existing articles is a one time process? Unfortunately, no. These sites are encyclopedias, so when you add articles to it. For example, let's say I have an article about George Washington, which I added on day one, and mentions Valley Forge. However, I don't add the Valley Forge article until several months later. When I do add it, I need to make sure the first instance of Valley Forge in the Washington article correctly links to the new article. > I don't see how a pre-existing article could have made reference to an > article title that hasn't been published yet. Very easily:) Personally, I feel that this is a dangerous path to go down, but customers want this feature, despite the difficulty. On the other hand, they don't want to take the time to do it manually, which would make it 100% accurate. At this time, I just want to give it a shot and see if we can make it work. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From lhall at smartronix.com Thu Aug 27 14:42:31 2009 From: lhall at smartronix.com (Hall, Leam) Date: Thu, 27 Aug 2009 14:42:31 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com>, Message-ID: <0C4B6592-1C32-48E3-80B8-F0D1336F0421@mimectl> Maybe a nightly or weekly rebuild? Depends on frequency of updates. Leam -------------- next part -------------- An HTML attachment was scrubbed... URL: From randalrust at gmail.com Thu Aug 27 14:46:17 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 27 Aug 2009 14:46:17 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <0C4B6592-1C32-48E3-80B8-F0D1336F0421@mimectl> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <0C4B6592-1C32-48E3-80B8-F0D1336F0421@mimectl> Message-ID: On Thu, Aug 27, 2009 at 2:42 PM, Hall, Leam wrote: > Maybe a nightly or weekly rebuild? Depends on frequency of updates. Conceptually, that makes sense. It is certainly something to consider. However, these clients are typically librarians, historians and other public sector-type minds. I will have to figure out how to explain that to them in their language:) -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From glenn310b at mac.com Thu Aug 27 14:50:57 2009 From: glenn310b at mac.com (Glenn Powell) Date: Thu, 27 Aug 2009 14:50:57 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> Message-ID: <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> Ah. New article titles are based on phrases from pre-existing content. On Aug 27, 2009, at 2:37 PM, Randal Rust wrote: > On Thu, Aug 27, 2009 at 11:40 AM, Glenn Powell > wrote: > >> Maybe altering the existing articles is a one time process? > > Unfortunately, no. These sites are encyclopedias, so when you add > articles to it. For example, let's say I have an article about George > Washington, which I added on day one, and mentions Valley Forge. > However, I don't add the Valley Forge article until several months > later. When I do add it, I need to make sure the first instance of > Valley Forge in the Washington article correctly links to the new > article. > >> I don't see how a pre-existing article could have made reference to >> an >> article title that hasn't been published yet. > > Very easily:) > > Personally, I feel that this is a dangerous path to go down, but > customers want this feature, despite the difficulty. On the other > hand, they don't want to take the time to do it manually, which would > make it 100% accurate. > > At this time, I just want to give it a shot and see if we can make > it work. > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From lhall at smartronix.com Thu Aug 27 14:55:26 2009 From: lhall at smartronix.com (Hall, Leam) Date: Thu, 27 Aug 2009 14:55:26 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> , <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> Message-ID: <648BB459-0A57-4E29-9CA5-D8BF6B234FE7@mimectl> Would it work to have key phrases tied to data stores? That way you could link to it and get all the articles on Valley Forge just by updating the datastore? Leam From: Glenn Powell Sent: Thu 8/27/2009 2:50 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Dynamically Add Links to Text Ah. New article titles are based on phrases from pre-existing content. -------------- next part -------------- An HTML attachment was scrubbed... URL: From randalrust at gmail.com Thu Aug 27 14:55:48 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 27 Aug 2009 14:55:48 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> Message-ID: On Thu, Aug 27, 2009 at 2:50 PM, Glenn Powell wrote: > Ah. New article titles are based on phrases from pre-existing content. Yes. What usually happens in these projects is that a team of writers cranks out roughly 300-600 articles on various subjects. After the site launches, the core editorial staff continues adding and expanding on each subject at a clip of about 300 articles per year. These are not wikipedia-type encyclopedias. They are produced by historical societies, humanities councils and universities as reference works. Most of the people that actually do the data-entry are not very tech-savvy, so we try to make the system do as much of the heavy lifting as possible. But there are times when you just have to level with them and say, "Sorry, if you want 100% accuracy, you have to do it the old-fashioned way." -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From chuck.reeves at gmail.com Thu Aug 27 14:56:45 2009 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Thu, 27 Aug 2009 14:56:45 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <0C4B6592-1C32-48E3-80B8-F0D1336F0421@mimectl> Message-ID: > > Conceptually, that makes sense. It is certainly something to consider. > However, these clients are typically librarians, historians and other > public sector-type minds. I will have to figure out how to explain > that to them in their language:) When you need to explain something to Lay people I find that its easier to try and equate it to something universal. If they are librarians, you can tell them that its like having a book shelf that is full and when a new book that comes in that needs to go on that shelf, you need time to shuffle all the books around. Tell them that it would be counter productive to do that while customers are in library, Thank You Chuck Reeves Cell: 631-374-0772 Email: chuck.reeves at gmail.com On Thu, Aug 27, 2009 at 2:46 PM, Randal Rust wrote: > On Thu, Aug 27, 2009 at 2:42 PM, Hall, Leam wrote: > > > Maybe a nightly or weekly rebuild? Depends on frequency of updates. > > Conceptually, that makes sense. It is certainly something to consider. > However, these clients are typically librarians, historians and other > public sector-type minds. I will have to figure out how to explain > that to them in their language:) > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > 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 Aug 27 14:59:56 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Thu, 27 Aug 2009 14:59:56 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <0C4B6592-1C32-48E3-80B8-F0D1336F0421@mimectl> Message-ID: <8f0676b40908271159h6857334di5c34d42f7b4184df@mail.gmail.com> On Thu, Aug 27, 2009 at 2:46 PM, Randal Rust wrote: > On Thu, Aug 27, 2009 at 2:42 PM, Hall, Leam wrote: > >> Maybe a nightly or weekly rebuild? Depends on frequency of updates. > > Conceptually, that makes sense. It is certainly something to consider. > However, these clients are typically librarians, historians and other > public sector-type minds. I will have to figure out how to explain > that to them in their language:) The way Wikipedia does this is by allowing robot editors. The bots go through the wikitext and fix things, and everyone can see the changes the bot made. A human can rollback the changes if the bot does something stupid. If you already have versioning of the articles, and the ability to approve edits, then creating a "robot-link-adder" editor that runs on a cron job should be a concept that librarians and historians can understand. From randalrust at gmail.com Thu Aug 27 15:04:28 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 27 Aug 2009 15:04:28 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <648BB459-0A57-4E29-9CA5-D8BF6B234FE7@mimectl> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <648BB459-0A57-4E29-9CA5-D8BF6B234FE7@mimectl> Message-ID: On Thu, Aug 27, 2009 at 2:55 PM, Hall, Leam wrote: > Would it work to have key phrases tied to data stores? That way you could > link to it and get all the articles on Valley Forge just by updating the > datastore? In the current version of the system, that is what we do. Users can create a list of 'related entries' in one of two ways: 1. Enter a string, like 'washington' and search all of the entries. This returns a list of all entries that contain the string and the user can check a box and save the selected records to the list of related entries. 2. The user can have the system auto-generate the list of related entries, based on the title. So if the title of the entry is 'George Washington' the system returns a list of all entries that contain that string. Then they can pick the ones they want to add to the list. I suppose that we could make it a lot easier on the system by simply using the titles of the entries that end up in the related entries list. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From randalrust at gmail.com Thu Aug 27 15:05:37 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 27 Aug 2009 15:05:37 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <0C4B6592-1C32-48E3-80B8-F0D1336F0421@mimectl> Message-ID: On Thu, Aug 27, 2009 at 2:56 PM, Chuck Reeves wrote: > When you need to explain something to Lay people I find that its easier to > try and equate it to something universal. > > If they are librarians, you can tell them that its like having a book shelf > that is full and when a new book that comes in that needs to go on that > shelf, you need time to shuffle all the books around.? Tell them that it > would? be counter productive to do that while customers are in library, LOL. That is a perfect explanation! -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From randalrust at gmail.com Thu Aug 27 15:11:29 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 27 Aug 2009 15:11:29 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <8f0676b40908271159h6857334di5c34d42f7b4184df@mail.gmail.com> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <0C4B6592-1C32-48E3-80B8-F0D1336F0421@mimectl> <8f0676b40908271159h6857334di5c34d42f7b4184df@mail.gmail.com> Message-ID: On Thu, Aug 27, 2009 at 2:59 PM, John Campbell wrote: > The way Wikipedia does this is by allowing robot editors. ?The bots go > through the wikitext and fix things, and everyone can see the changes > the bot made. ?A human can rollback the changes if the bot does > something stupid. That could work. We do not currently do version control, but that is on the roadmap. It's one of those things that gets overly complicated for some people. > creating a "robot-link-adder" editor that runs on > a cron job should be a concept that librarians and historians can > understand. You would think. I actually did a workshop yesterday and the one librarian in the group got all confused over the term 'module' for the CMS. He kept going back and saying, "Aren't these all just objects?" Librarians are very smart people, but the ones I have had to deal with tend to have issues when you don't use the concepts they are used to. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From chuck.reeves at gmail.com Thu Aug 27 15:30:23 2009 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Thu, 27 Aug 2009 15:30:23 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <0C4B6592-1C32-48E3-80B8-F0D1336F0421@mimectl> Message-ID: Yea im good at those so if any one needs them you can ask me ;) Thank You Chuck Reeves Cell: 631-374-0772 Email: chuck.reeves at gmail.com On Thu, Aug 27, 2009 at 3:05 PM, Randal Rust wrote: > On Thu, Aug 27, 2009 at 2:56 PM, Chuck Reeves > wrote: > > > When you need to explain something to Lay people I find that its easier > to > > try and equate it to something universal. > > > > If they are librarians, you can tell them that its like having a book > shelf > > that is full and when a new book that comes in that needs to go on that > > shelf, you need time to shuffle all the books around. Tell them that it > > would be counter productive to do that while customers are in library, > > LOL. That is a perfect explanation! > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > 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 michael.southwell at nyphp.com Thu Aug 27 16:10:07 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Thu, 27 Aug 2009 16:10:07 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> Message-ID: <4A96E81F.7060507@nyphp.com> Glenn Powell wrote: > Ah. New article titles are based on phrases from pre-existing content. I'll bet you could pre-create most of the links every time you write an article. I mention Valley Forge, I think "there should be an article on that some day", and so I create the link right then. When the article is displayed, you check to see whether the target exists; if it does, you display the link; if it doesn't, you display the text without the link. That could at least make things easier in the future (maybe). -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From amuraco at gmail.com Thu Aug 27 16:16:20 2009 From: amuraco at gmail.com (Andrew Muraco) Date: Thu, 27 Aug 2009 16:16:20 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <4A96E81F.7060507@nyphp.com> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> Message-ID: But you have to consider that chances are, the person entering the article won't select all the possible keywords that could become links ahead of time, so you'd end up with articles that don't have enough links.. but I like the idea. Personally, i think a spider/bot is the best bet, maintain a list of phrases/words that should point to links and add those in. Alternately, when a new article gets created search for all the articles that might need a reference to it and ask the user to select which ones to process (automagically add links to the new article) (avoids the time gap of a bot) On Thu, Aug 27, 2009 at 4:10 PM, Michael Southwell < michael.southwell at nyphp.com> wrote: > Glenn Powell wrote: > >> Ah. New article titles are based on phrases from pre-existing content. >> > > I'll bet you could pre-create most of the links every time you write an > article. I mention Valley Forge, I think "there should be an article on that > some day", and so I create the link right then. When the article is > displayed, you check to see whether the target exists; if it does, you > display the link; if it doesn't, you display the text without the link. That > could at least make things easier in the future (maybe). > > > -- > ================= > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From randalrust at gmail.com Thu Aug 27 16:26:31 2009 From: randalrust at gmail.com (Randal Rust) Date: Thu, 27 Aug 2009 16:26:31 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> Message-ID: On Thu, Aug 27, 2009 at 4:16 PM, Andrew Muraco wrote: > Personally, i think a spider/bot is the best bet, maintain a list of > phrases/words that should point to links and add those in. I am leaning towards thinking that is the best option. The other way would be to simply provide the editor with a button they can click that automatically does the updates and then provides a list of articles that they need to review. If all is good, then they can approve and publish. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From tedd at sperling.com Thu Aug 27 17:11:28 2009 From: tedd at sperling.com (tedd) Date: Thu, 27 Aug 2009 17:11:28 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: Message-ID: At 10:04 AM -0400 8/27/09, Randal Rust wrote: >In one of our applications, we have a need to apply inline links to >the text, and would like to figure out a way to do this dynamically. I >have looked for this high and low, but haven't been able to find what >I am looking for. Perhaps I am searching the wrong keywords. > >What we have is a repository of 1,000 articles. Each article has a >unique title. If the title of that article appears in another article, >we want to apply a link to the text, but only the first instance of >the text. > >My thought is that we have to: > >1. create an array of all titles >2. create a variable that holds the article text >3. loop through the title array and search the article text for a match >4. the first instance that a match is found, append the link and >update the string variable > >The trick is that when a new article is added, they system needs to >automatically go back to all of the existing articles and run through >this process, which I don't like, because this won't be 100% accurate >in the editor's eyes. each updated article needs to be reviewed. I >also think it would cause a performance hit and dramatically slow down >the system, especially in one installation where we have nearly 4,000 >record that would need to be updated. > >Personally, it seems to me that JavaScript is a better solution here, >and to simply append those links when the page loads. Unfortunately, >these sites all have to comply with Section 508 and other >accessibility guidelines, so that might not be an acceptable solution. > >Any suggestions? > >-- >Randal Rust Randal: The way I would handle this would be like so: Create a database that would contain a table that would hold your articles. The table would have an index (ID), title of the article, and the meat of the article. It could have other fields, but for sake of demonstration let's use just those three. Normally if one wanted to see an article all they would have to know is the ID of the article and send that ID to a script that would display the article -- something like display-article.php&id=215. Note I am sending the id of the article and not the title of the article to the display script. With that said, all that would be needed would be a one-time search through all the articles looking for all the titles you have in your article table . This could be accomplished with a FULL TEXT search. When a title is found, then simply add text to each title that would make it a link. For example, if your script found "History of America" with an ID of 215 and then the script would alter that string like so: History of America As such, your article linking problem would be solved. Now if you add another article, then the process needs to be reset and redone. In other words, find all links and remove them leaving the titles. The only fly in the ointment is if your articles already have links -- if so, then you could get around that problem by simply adding a class attribute to your new links, like so: History of America A such, when the script finds a link with a "dyn-link" class, then it simply removes that link and returns the article from above to "History of America". Note that class attributes don't alter anything unless you specify them in your css/ Then rinse, repeat and the problem is solved. This would work and only needs to be "rinsed and repeated" when new articles are added OR when old articles are removed. Additionally, this could be done in a instant by locking the table, doing the update, and unlocking the table without any noticeable interruption. Cheers, tedd PS: No javascript required. -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From glenn310b at mac.com Thu Aug 27 17:12:56 2009 From: glenn310b at mac.com (Glenn Powell) Date: Thu, 27 Aug 2009 17:12:56 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> Message-ID: <0A0F0C82-E021-4766-AD0E-02303E3DA556@mac.com> If the article copy is stored in the db, and you've got sql to work with, then at the point of publication of a new article, it might be possible to narrow the targets with; select id from articles where article_text like %valley forge%"; (or something like that). Then you can do whatever you need to on only those ids. That might avoid the overhead of selecting the content of all the articles for processing in php. On Aug 27, 2009, at 4:26 PM, Randal Rust wrote: > On Thu, Aug 27, 2009 at 4:16 PM, Andrew Muraco > wrote: > >> Personally, i think a spider/bot is the best bet, maintain a list of >> phrases/words that should point to links and add those in. > > I am leaning towards thinking that is the best option. The other way > would be to simply provide the editor with a button they can click > that automatically does the updates and then provides a list of > articles that they need to review. If all is good, then they can > approve and publish. > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From glenn310b at mac.com Thu Aug 27 17:30:42 2009 From: glenn310b at mac.com (Glenn Powell) Date: Thu, 27 Aug 2009 17:30:42 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> Message-ID: continuation from last post... and another idea... When you get the list of record ids, select enough of the text around the (target phrase to be "linkafied") to give it some context, and, at the point of publication of a new article, display those blurbs in a list with a pre checked checkbox for each one. When the editor publishes a new article, they get a list of only what will be linked, with enough context to uncheck it if they don't want it linked. When they hit publish, either queue up the job, or just update and create the links then. wouldn't work so well if there were 10,000 past articles to have links added to... On Aug 27, 2009, at 4:26 PM, Randal Rust wrote: > On Thu, Aug 27, 2009 at 4:16 PM, Andrew Muraco > wrote: > >> Personally, i think a spider/bot is the best bet, maintain a list of >> phrases/words that should point to links and add those in. > > I am leaning towards thinking that is the best option. The other way > would be to simply provide the editor with a button they can click > that automatically does the updates and then provides a list of > articles that they need to review. If all is good, then they can > approve and publish. > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From lists at nopersonal.info Thu Aug 27 18:02:14 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Thu, 27 Aug 2009 18:02:14 -0400 Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <1251318860.30499@coral.he.net> References: <1251318860.30499@coral.he.net> Message-ID: <4A970266.3040101@nopersonal.info> Kristina D. H. Anderson wrote: > Hi Bev, > > Another good tip someone gave me is to train yourself to automatically > back up any file by adding the date in format _20090826 to the filename > before you edit or overwrite it, and that way you can always roll back > your files and have a day by day history of the code. > > Again like with your log file, it will grow and soon you will have 16 > different copies of each active file on your test server. But it's > simple, free and most importantly EASY TO INSTALL :) Hi Kristina, LOL, yep, that type of revision control is definitely the easiest to install! I've actually been using that method for years with HTML files, but I'm finding it to be a PITA when working with PHP. One reason is that when I have a lot of files with similar names it's far too easy to select & edit the wrong one (even though I keep a /_trash dir in an attempt to manage the older stuff). Another reason is that if I haven't been working on a project for a few days, it's hard to remember what I was doing with a particular version of a file unless I also add some sort of description to its name. So I end up with things like customer_edit_dd_filter_2009-08-26.php and customer_edit_table_sort_2009-08-26.php. Ugh. Last but not least, because of my inexperience, it's rare for me to only have one version of a file on a given day. So even without the descriptions added to the file names, I'd still end up with things like customer_edit_2009-08-26.php, customer_edit_2009-08-26_2.php, customer_edit_2009-08-26_3.php, and so on. It gets REALLY confusing. Luckily, I make weekly backups to an external drive, so I've never made a mess that I couldn't recover from, but still...I've wasted a LOT of time trying to figure out where I was and get a file back to a usable state, you know? I think it's definitely time for me to buckle down move on to some sort of VCS--I figure however steep the learning curve might be, it can't be worse than the amount of time I've already lost on manual recoveries. > And in terms of tracking "to do" items, I just keep a text file in each > active project in which I keep detailed notes and to do punchlists and > etc. Thanks, that's a good idea. I tend to make my lists on paper, sticky notes, or a whiteboard. (I especially enjoy ripping sticky notes off my monitor and tossing them in the trash when something's finally done *grin*) But now that you mention it, it would probably be better to have an electronic file so I can go back & review steps I took on any given project to see what I did and how/if I might improve things. > I lack patience for stuff that is needlessly complex as I've always > been a "brute force by text editor" type of programmer. I just try to > follow the "KISS" method, and avoid as many hazards as possible. And I > would certainly hesitate to hold myself out as a "productivity guru" -- > I tend to work in fits and starts and be insanely productive some days, > and then other days it just isn't really working for me so much... I prefer simplicity too, but I freak out when my files start getting messy because I have a hard enough time keeping my thoughts organized when working with PHP & MySQL. I wish I could keep my apartment as orderly as my files... ;o) > Love Ajai's suggestion for XDebug but fear the installation > documentation may be my undoing! :) Same here! Thanks again for your help. Bev From lists at nopersonal.info Thu Aug 27 19:21:30 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Thu, 27 Aug 2009 19:21:30 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: <4A8D52FE.6070200@gmx.com> <4A90C6DD.90300@nopersonal.info> <58f08dcf0908230731s33e8d5f9sdfcc82490530c92c@mail.gmail.com> <4A93EBF3.1090306@nopersonal.info> <4A95876B.8020901@nopersonal.info> Message-ID: <4A9714FA.6050109@nopersonal.info> Somehow my earlier reply to this went only to tedd instead of the list. I guess I need to hit "reply to all" from now on. Anyhoo... tedd wrote: > When it comes to teaching (I do teach at college level), there are very > few students/clients who fully realize all that's involved in developing > a web site. Many think, as I've been told "It's easy -- my son learned > HTML in high school" while they are totally clueless. The most > problematic students/clients are the ones who have some experience with > HTML and think that's all there is. Gah! I hate hearing, "I need you to make a change. It's something simple, so it should be really easy." Uh-huh, and you're making that assumption based on...??? I think FrontPage, and to a certain extent Dreamweaver & other WYSIWYG editors, have created this deceptive "it's easy" notion. MS Office doesn't help with it's one-click "publish to web" options. Don't get me wrong--Dreamweaver is a great tool that I use it every day for both HTML & PHP, but I know how to hand code and I never, ever work in design mode. I like it for its organization, synchronization, and code completion abilities (I'm an awful typist). I also like the new code navigation & associated files abilities in CS4 that let me work in split view and easily jump around my code. I've never worked with the server behaviors though--that has always struck me a a very, very bad idea for someone who's still learning PHP. > http://sperling.com/web-developer.php > > http://sperling.com/four-things-clients-should-know.php Good stuff, thanks! > And lastly, none of this is static. I spend time every day learning > something new -- the web is constantly changing and keeping up with it > is a daily challenge. I was quoted a long time ago as saying: Exactly. As I speak, there's a designer on one of the forums I frequent who's insisting on letting PHOTOSHOP write his code for him, and then trying to edit it in Dreamweaver. Naturally, his designer's eye wants things to look a certain way and that's not happening because he has almost no knowledge of HTML, CSS or javascript. The positively hideous code soup that Photoshop created isn't helping. I like to "pay it forward" and help people, but only if they're will to make an effort to learn & practice. I'm not touching this one. > "I've learned something new every day of my life -- and I'm getting > damned tried of it." LOL, nice quote. Bev From tedd at sperling.com Thu Aug 27 20:37:28 2009 From: tedd at sperling.com (tedd) Date: Thu, 27 Aug 2009 20:37:28 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: <4A9714FA.6050109@nopersonal.info> References: <4A8D52FE.6070200@gmx.com> <4A90C6DD.90300@nopersonal.info> <58f08dcf0908230731s33e8d5f9sdfcc82490530c92c@mail.gmail.com> <4A93EBF3.1090306@nopersonal.info> <4A95876B.8020901@nopersonal.info> <4A9714FA.6050109@nopersonal.info> Message-ID: At 7:21 PM -0400 8/27/09, lists at nopersonal.info wrote: >Don't get me wrong--Dreamweaver is a great tool that I use it every day >for both HTML & PHP, but I know how to hand code and I never, ever work >in design mode. I like it for its organization, synchronization, and >code completion abilities (I'm an awful typist). I use GoLive for exactly the same thing. However, Adobe dropped GoLive so I bought DW. Unfortunately, DW doesn't cut it for me -- it's like GoLive, but less. So, I am moving to Eclipse. It has a steep learning curve and does things a bit different, but is well worth the effort. Plus, I can use if for other development (i.e., JAVA). In addition, it's free and doesn't depend upon a cost/benefit analysis of some corporate management types to remain in existence. No longer will I find myself painted into a dead-end as I have been in at least a dozen different languages and IDE's because the brain-dead majority of users didn't buy it. Besides, the web has become sophisticated enough to support some very professional tools and we need to keep up if we are to remain competitive. As Will Rogers once said "You may be on the right track, but if you don't move along you'll get run over." Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ajai at bitblit.net Thu Aug 27 23:58:11 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Thu, 27 Aug 2009 23:58:11 -0400 (EDT) Subject: [nycphp-talk] Advice on setting for testing server In-Reply-To: <4A95904F.4070207@nopersonal.info> Message-ID: On Wed, 26 Aug 2009, lists at nopersonal.info wrote: > I actually like the part of maintaining a server I used to too... but at a certain point you get more servers and realize its a lot of time to maintain all of them... -- Aj. From petros.ziogas at gmail.com Fri Aug 28 06:00:05 2009 From: petros.ziogas at gmail.com (Petros Ziogas) Date: Fri, 28 Aug 2009 13:00:05 +0300 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> Message-ID: <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> I would just like to mention a point of failure in that automated proccess. I had to deal with this in a previous project so it's quite fresh. What will happen if: e.g. There are 3 articles. Article A is titled "History of America". Article B is titled "Glorious History of America". In article C there is this text "The book is talking about the glorious history of America". If you run an automated proccess and the test for article A comes first then the text will be "The book is talking about the glorious history of America" and the next test will fail. If you run a test for article B first the text will become "The book is talking about the glorious history of America". Then if you test for article A it might end up being "The book is talking about the glorious history of America" The possibilities of such procedured practically ruining your content are endless. If you want to dive into tag nesting and html validation you will be opening another whole. Also what will happen if an editor want to insert this "I loved the book George Washington and the Glorious history of America." and there are articles with titles using "George Washington", "Glorious history", "History of America", "America"? I think you get my point... What I have ended up with is human editors. Not manually editing the links of course. A bot proposes edits all the time and an editor decides what changes to accept and what to reject. Of course the robot should be clever and propose changes that make sense and not repeat the same propositions all over. It's a challenging task but that's why we are here, right? Petros Ziogas http://www.royalblue.gr On Fri, Aug 28, 2009 at 12:30 AM, Glenn Powell wrote: > continuation from last post... and another idea... > > When you get the list of record ids, select enough of the text around the > (target phrase to be "linkafied") to give it some context, > and, at the point of publication of a new article, display those blurbs in > a list with a pre checked checkbox for each one. > > When the editor publishes a new article, they get a list of only what will > be linked, with enough context to uncheck it if they > don't want it linked. > > When they hit publish, either queue up the job, or just update and create > the links then. > > wouldn't work so well if there were 10,000 past articles to have links > added to... > > On Aug 27, 2009, at 4:26 PM, Randal Rust wrote: > > On Thu, Aug 27, 2009 at 4:16 PM, Andrew Muraco wrote: >> >> Personally, i think a spider/bot is the best bet, maintain a list of >>> phrases/words that should point to links and add those in. >>> >> >> I am leaning towards thinking that is the best option. The other way >> would be to simply provide the editor with a button they can click >> that automatically does the updates and then provides a list of >> articles that they need to review. If all is good, then they can >> approve and publish. >> >> -- >> Randal Rust >> R.Squared Communications >> www.r2communications.com >> 614-370-0036 >> _______________________________________________ >> 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 randalrust at gmail.com Fri Aug 28 08:21:15 2009 From: randalrust at gmail.com (Randal Rust) Date: Fri, 28 Aug 2009 08:21:15 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> Message-ID: On Fri, Aug 28, 2009 at 6:00 AM, Petros Ziogas wrote: > I think you get my point... LOL. Oh yes. I have spent a lot of time thinking about this over the past few years, so a lot of the issues discussed in this thread I have thought of, but there have been some new ones. It has been a very helpful discussion. > What I have ended up with is human editors. Not manually editing the links > of course. A bot proposes edits all the time and an editor decides what > changes to accept and what to reject. When the editor builds the list of related articles, that is essentially what the automated process does. I think what we can do is add some new functionality called 'Link to Related Articles.' When the editor clicks the [Find Matches] button, the system can return a list of the articles that match the title of the article they are working on. This can also populate a dropdown list of the articles, so the editor can highlight the text they want to create the link to, then select the appropriate article from the dropdown and click [Apply Link]. This does create more data entry for the editor and the rest of the staff, but it should be much more accurate. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From lists at zaunere.com Fri Aug 28 10:19:43 2009 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 28 Aug 2009 10:19:43 -0400 Subject: [nycphp-talk] OOP, Frameworks, ONLAMP, and NYPHP In-Reply-To: <4A950762.6050000@reuel.net> References: <4A950762.6050000@reuel.net> Message-ID: <086f01ca27ea$96e9b690$c4bd23b0$@com> Hi Leam, > More timing...or synchronicity... > > As we discuss the learning path and stages, I've heard that ONLAMP will > not really continue. I mentioned ONLAMP's aged articles to you a few > months ago and was all hyped about upgrade and reform. ONLAMP has helped > me in several ways and it's nice to have links to go back to as I try to > understand sub-topics. > > NYPHP has PHundamentals. Not as extensive as ONLAMP, but with more > growth potential. Also, I will note that not only do I not live in or > near the City but yesterday I pointed a PHP newbie to this list as a > great resource. If you want somewhere culturally and economically, if > not geographically, distant from NYC, come on down to SW Ga for a > visit! > > So the question on personal growth seems to have an option of expanding > the NYPHP sphere of influence. With ONLAMP receding is this a good time > to grow the PHundamentals and NYPHP? Or are there other places and > portals to fill ONLAMP's shoes? Regarding PHundamentals, it's certainly been a great resource over the years thanks to the time and effort put into it, and the quality/participation of the list members. It has, obviously, stalled and become a bit outdated itself. Picking them back up would be a great thing, although time obviously is always the most scarce commodity. If someone would want to help picking them back up, it'd be a great thing. And in fact with today's Web 2.0 facey-spaces and twitter-books, perhaps even more value would come. As part of PHundamentals, we could also construct an open source project to facilitate the PHundamentals process. We'd just need some people (far or near to NYC) to help out... takers? H From tedd at sperling.com Fri Aug 28 10:51:36 2009 From: tedd at sperling.com (tedd) Date: Fri, 28 Aug 2009 10:51:36 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> Message-ID: At 1:00 PM +0300 8/28/09, Petros Ziogas wrote: >I would just like to mention a point of failure in that automated >proccess. I had to deal with this in a previous project so it's >quite fresh. > >What will happen if: Problem 1 >There are 3 articles. Article A is titled "History of America". >Article B is titled "Glorious History of America". In article C >there is this text "The book is talking about the glorious history >of America". If you run an automated proccess and the test for >article A comes first then the text will be "The book is talking >about the glorious history of America" and >the next test will fail. > >If you run a test for article B first the text will become "The book >is talking about the glorious history of >America". Then if you test for article A it might end up >being "The book is talking about the glorious href="/id1111/">history of America" > >The possibilities of such procedured practically ruining your >content are endless. If you want to dive into tag nesting and html >validation you will be opening another whole. Problem 2 >Also what will happen if an editor want to insert this "I loved the >book George Washington and the >Glorious history of America." and there are articles with titles >using "George Washington", "Glorious history", "History of America", >"America"? > >I think you get my point... Petros: Yes, I see your point and the two problems you raise (good concerns). Problem 1 My initial solution would solve the first problem *provided* that the titles were unique and not contained within another title, right? So why not start with the longest title and search/replace downwards? For example, "Glorious History of America" is searched, found, and made a link. Then "History of America" is searched -- however -- the search excludes links! The phrase "History of America" in "Glorious History of America" would never be considered because it's within a link. The process would continue until you run out of titles -- simple, right? Problem 2 The second problem can be solved two ways: Way one -- by removing all organic links from the initial search. In other words, when the FULL TEXT search is started the search is done on articles absent of all organic links. You can easily add the organic links back-in after the search/replace is finished. Please note when the automated links are added, they also have an unique class attribute, such as class="autotag", which will allow them to be easily identified and removed for a rebuild. Way two -- you could solve the problem by excluding organic links from the search because they DO NOT have the unique class attribute identifier -- thus no real reason to remove them at all for the search/replace routine (i.e., Way 1). I only presented "Way 1" to get you to think in terms of removing the organic links from the problem. Possible problem The only fly in the ointment here would be if an editor wants to manually link an article by trying to mimic the automated process. For example, he/she inserts a "History of America" using the *index* of the article. Everything would still work unless that article is deleted. In such case the link would become dead. However, if the editor simply added the class identifier tag (i.e., class="autotag") to the link, then the automated process would treat his entry like it's own and adjust accordingly. If the editors simply followed the rules, which aren't complicated, then editors could participate as they want in the process. The solution presented here doesn't require tag nesting or html validation. As such, I don't see any additional problems -- do you? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Fri Aug 28 10:53:22 2009 From: tedd at sperling.com (tedd) Date: Fri, 28 Aug 2009 10:53:22 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> Message-ID: At 8:21 AM -0400 8/28/09, Randal Rust wrote: >On Fri, Aug 28, 2009 at 6:00 AM, Petros Ziogas wrote: > >> I think you get my point... > >LOL. Oh yes. I have spent a lot of time thinking about this over the >past few years, so a lot of the issues discussed in this thread I have >thought of, but there have been some new ones. It has been a very >helpful discussion. Please consider what I offered -- I think it will work. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From chuck.reeves at gmail.com Fri Aug 28 11:05:34 2009 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Fri, 28 Aug 2009 11:05:34 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <67E2F7D6-80D7-4CD2-8E94-75306A5F1A51@mac.com> <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> Message-ID: Another little add on to these solutions would be to include some kind of counter that will prevent the bot form linking more then X times. This way when the article loads, it will not be just one big stream of links. Thank You Chuck Reeves Cell: 631-374-0772 Email: chuck.reeves at gmail.com On Fri, Aug 28, 2009 at 10:51 AM, tedd wrote: > At 1:00 PM +0300 8/28/09, Petros Ziogas wrote: > >> I would just like to mention a point of failure in that automated >> proccess. I had to deal with this in a previous project so it's quite fresh. >> >> What will happen if: >> > > Problem 1 > > There are 3 articles. Article A is titled "History of America". Article B >> is titled "Glorious History of America". In article C there is this text >> "The book is talking about the glorious history of America". If you run an >> automated proccess and the test for article A comes first then the text will >> be "The book is talking about the glorious history of >> America" and the next test will fail. >> >> If you run a test for article B first the text will become "The book is >> talking about the glorious history of America". Then >> if you test for article A it might end up being "The book is talking about >> the glorious history of >> America" >> >> The possibilities of such procedured practically ruining your content are >> endless. If you want to dive into tag nesting and html validation you will >> be opening another whole. >> > > Problem 2 > > Also what will happen if an editor want to insert this "I loved the book >> George Washington and the Glorious history of >> America." and there are articles with titles using "George Washington", >> "Glorious history", "History of America", "America"? >> >> I think you get my point... >> > > Petros: > > Yes, I see your point and the two problems you raise (good concerns). > > Problem 1 > > My initial solution would solve the first problem *provided* that the > titles were unique and not contained within another title, right? So why not > start with the longest title and search/replace downwards? > > For example, "Glorious History of America" is searched, found, and made a > link. Then "History of America" is searched -- however -- the search > excludes links! The phrase "History of America" in "Glorious History of > America" would never be considered because it's within a link. > > The process would continue until you run out of titles -- simple, right? > > Problem 2 > > The second problem can be solved two ways: > > Way one -- by removing all organic links from the initial search. In other > words, when the FULL TEXT search is started the search is done on articles > absent of all organic links. You can easily add the organic links back-in > after the search/replace is finished. > > Please note when the automated links are added, they also have an unique > class attribute, such as class="autotag", which will allow them to be easily > identified and removed for a rebuild. > > Way two -- you could solve the problem by excluding organic links from the > search because they DO NOT have the unique class attribute identifier -- > thus no real reason to remove them at all for the search/replace routine > (i.e., Way 1). I only presented "Way 1" to get you to think in terms of > removing the organic links from the problem. > > Possible problem > > The only fly in the ointment here would be if an editor wants to manually > link an article by trying to mimic the automated process. For example, > he/she inserts a "History of America" using the > *index* of the article. Everything would still work unless that article is > deleted. In such case the link would become dead. > > However, if the editor simply added the class identifier tag (i.e., > class="autotag") to the link, then the automated process would treat his > entry like it's own and adjust accordingly. > > If the editors simply followed the rules, which aren't complicated, then > editors could participate as they want in the process. > > The solution presented here doesn't require tag nesting or html validation. > As such, I don't see any additional problems -- do you? > > Cheers, > > tedd > > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.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 chuck.reeves at gmail.com Fri Aug 28 13:34:56 2009 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Fri, 28 Aug 2009 13:34:56 -0400 Subject: [nycphp-talk] Short Tags deprecated? Message-ID: I think there is some discrepancy with this ini directive. In the study book "Zend PHP5 Certification Guide" form PHP|Architect, It states that the short tags are deprecated. I am not seeing any other references to short tags being deprecated. In fact in the documentation for the Zend Framework, it's stating that short tags can be used as long as the directive is turned on: http://framework.zend.com/manual/en/zend.view.html#zend.view.introduction.shortTags Has any one out there heard of short tags being deprecated? Thank You Chuck Reeves Cell: 631-374-0772 Email: chuck.reeves at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Fri Aug 28 13:40:21 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 28 Aug 2009 13:40:21 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: Message-ID: <20090828174020.GA7518@panix.com> Hi Chuck: I recall some talk on PHP's internals list about this subject, maybe six months to a year ago. It was decided they will not be removed. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at zaunere.com Fri Aug 28 13:45:36 2009 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 28 Aug 2009 13:45:36 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: Message-ID: <00d101ca2807$59828ad0$0c87a070$@com> > I think there is some discrepancy with this ini directive. In the > study book "Zend PHP5 Certification Guide" form PHP|Architect, It > states that the short tags are deprecated. I am not seeing any other > references to short tags being deprecated. In fact in the > documentation for the Zend Framework, it's stating that short tags can > be used as long as the directive is turned on: > > http://framework.zend.com/manual/en/zend.view.html#zend.view.introducti > on.shortTags > > Has any one out there heard of short tags being deprecated? There was some discussion that they would be deprecated, but I think it ended up that they're just disabled by default now if you use the recommended ini. I always turn them on. There was some other discussion about a replacement for them (that wouldn't interfere with XML documents) but that's stalled AFAIK. The curly syntax for accessing chars in a string is apparently officially deprecated now: http://us2.php.net/manual/en/language.types.string.php#language.types.string.substr :( H From paul at devonianfarm.com Fri Aug 28 13:49:40 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Fri, 28 Aug 2009 13:49:40 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: Message-ID: <4A9818B4.1060005@devonianfarm.com> Chuck Reeves wrote: > I think there is some discrepancy with this ini directive. In the > study book "Zend PHP5 Certification Guide" form PHP|Architect, It > states that the short tags are deprecated. I am not seeing any other > references to short tags being deprecated. In fact in the > documentation for the Zend Framework, it's stating that short tags can > be used as long as the directive is turned on: > > http://framework.zend.com/manual/en/zend.view.html#zend.view.introduction.shortTags > > > Has any one out there heard of short tags being deprecated? > I like the short tags, they're a comfortable syntax for templating that's both simpler and more powerful than templating "problems" like smarty. However, most PHP style guides advise against the short tags. I think they're not quite SGML compliant, so some HTML editors might not handle them correctly. Also, like magic_quotes_gpc, short tags may or may not be turned on for a given server, so it's one more thing that can break your app. Now, I'm sure ~your~ organization is better, but there are ~some~ organizations that have 10 web servers with PHP and it's pretty random if magic_quotes_gpc or short tags are turned on or off. http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use From monalisa20042006 at gmail.com Fri Aug 28 14:27:34 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Fri, 28 Aug 2009 21:27:34 +0300 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <4A9818B4.1060005@devonianfarm.com> References: <4A9818B4.1060005@devonianfarm.com> Message-ID: If you are using a host server that supports multiple programming languages this may be dangerous On Fri, Aug 28, 2009 at 8:49 PM, Paul A Houle wrote: > compliant, so some HTML editors might not handle them correctly. Also, > like magic_quotes_gpc, short tags may or may not be turned on for a given > server, so it's one more thing that can break your app. Now, I'm sure > ~your~ organization is better, b -------------- next part -------------- An HTML attachment was scrubbed... URL: From oorza2k5 at gmail.com Fri Aug 28 14:32:28 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Fri, 28 Aug 2009 14:32:28 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: <4A9818B4.1060005@devonianfarm.com> Message-ID: <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> On Fri, Aug 28, 2009 at 2:27 PM, Mona Borham wrote: > If you are using a host server that supports multiple programming languages > this may be dangerous > Or if you use a server that has References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> Message-ID: /agree which was why I thought this was deprecated. I guess since the webserver knows what parser to pull based off the file extension, it looks as if Zend has decided that there would be no benefit to deprecating this directive. Thank You Chuck Reeves Cell: 631-374-0772 Email: chuck.reeves at gmail.com On Fri, Aug 28, 2009 at 2:32 PM, Eddie Drapkin wrote: > On Fri, Aug 28, 2009 at 2:27 PM, Mona Borham > wrote: > > If you are using a host server that supports multiple programming > languages > > this may be dangerous > > > > Or if you use a server that has parsed as 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 Fri Aug 28 14:45:44 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Fri, 28 Aug 2009 14:45:44 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> Message-ID: On Fri, Aug 28, 2009 at 2:32 PM, Eddie Drapkin wrote: > On Fri, Aug 28, 2009 at 2:27 PM, Mona Borham wrote: >> If you are using a host server that supports multiple programming languages >> this may be dangerous >> > > Or if you use a server that has parsed as PHP. Which makes it seem like the obvious fix is to parse '?> Nice, huh? From petros.ziogas at gmail.com Fri Aug 28 15:11:02 2009 From: petros.ziogas at gmail.com (Petros Ziogas) Date: Fri, 28 Aug 2009 22:11:02 +0300 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> Message-ID: <236c3b210908281211s633fbe4eid4745182537f4c2a@mail.gmail.com> Hi Tedd, That were some good ideas about the problems that I thought will arise. What you forgeting is that you can't just decide what is more important and what is not. I mean it might be that logically the short article (e.g. America) should be linked and not the long one. If the articles are many and have organic (sorry I can't think of a better word) titles then it will produce weird results. I still think that automatically cross linking articles that might have small titles is a bad idea. Imagine imdb doing that and trying to crosslink the movie "Z" and the movie "IT" inside it's editors articles and reviews. I think that the best living example of this is the ad networks that link words to advertisements inside web site content. They can make a text almost unreadable when they insert the ad links. Petros Ziogas http://www.royalblue.gr On Fri, Aug 28, 2009 at 6:05 PM, Chuck Reeves wrote: > Another little add on to these solutions would be to include some kind of > counter that will prevent the bot form linking more then X times. This way > when the article loads, it will not be just one big stream of links. > > Thank You > Chuck Reeves > Cell: 631-374-0772 > Email: chuck.reeves at gmail.com > > > On Fri, Aug 28, 2009 at 10:51 AM, tedd wrote: > >> At 1:00 PM +0300 8/28/09, Petros Ziogas wrote: >> >>> I would just like to mention a point of failure in that automated >>> proccess. I had to deal with this in a previous project so it's quite fresh. >>> >>> What will happen if: >>> >> >> Problem 1 >> >> There are 3 articles. Article A is titled "History of America". Article B >>> is titled "Glorious History of America". In article C there is this text >>> "The book is talking about the glorious history of America". If you run an >>> automated proccess and the test for article A comes first then the text will >>> be "The book is talking about the glorious history of >>> America" and the next test will fail. >>> >>> If you run a test for article B first the text will become "The book is >>> talking about the glorious history of America". Then >>> if you test for article A it might end up being "The book is talking about >>> the glorious history of >>> America" >>> >>> The possibilities of such procedured practically ruining your content are >>> endless. If you want to dive into tag nesting and html validation you will >>> be opening another whole. >>> >> >> Problem 2 >> >> Also what will happen if an editor want to insert this "I loved the book >>> George Washington and the Glorious history of >>> America." and there are articles with titles using "George Washington", >>> "Glorious history", "History of America", "America"? >>> >>> I think you get my point... >>> >> >> Petros: >> >> Yes, I see your point and the two problems you raise (good concerns). >> >> Problem 1 >> >> My initial solution would solve the first problem *provided* that the >> titles were unique and not contained within another title, right? So why not >> start with the longest title and search/replace downwards? >> >> For example, "Glorious History of America" is searched, found, and made a >> link. Then "History of America" is searched -- however -- the search >> excludes links! The phrase "History of America" in "Glorious History of >> America" would never be considered because it's within a link. >> >> The process would continue until you run out of titles -- simple, right? >> >> Problem 2 >> >> The second problem can be solved two ways: >> >> Way one -- by removing all organic links from the initial search. In other >> words, when the FULL TEXT search is started the search is done on articles >> absent of all organic links. You can easily add the organic links back-in >> after the search/replace is finished. >> >> Please note when the automated links are added, they also have an unique >> class attribute, such as class="autotag", which will allow them to be easily >> identified and removed for a rebuild. >> >> Way two -- you could solve the problem by excluding organic links from the >> search because they DO NOT have the unique class attribute identifier -- >> thus no real reason to remove them at all for the search/replace routine >> (i.e., Way 1). I only presented "Way 1" to get you to think in terms of >> removing the organic links from the problem. >> >> Possible problem >> >> The only fly in the ointment here would be if an editor wants to manually >> link an article by trying to mimic the automated process. For example, >> he/she inserts a "History of America" using the >> *index* of the article. Everything would still work unless that article is >> deleted. In such case the link would become dead. >> >> However, if the editor simply added the class identifier tag (i.e., >> class="autotag") to the link, then the automated process would treat his >> entry like it's own and adjust accordingly. >> >> If the editors simply followed the rules, which aren't complicated, then >> editors could participate as they want in the process. >> >> The solution presented here doesn't require tag nesting or html >> validation. As such, I don't see any additional problems -- do you? >> >> Cheers, >> >> tedd >> >> >> -- >> ------- >> http://sperling.com http://ancientstones.com http://earthstones.com >> _______________________________________________ >> 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 oorza2k5 at gmail.com Fri Aug 28 15:33:47 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Fri, 28 Aug 2009 15:33:47 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> Message-ID: <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> On Fri, Aug 28, 2009 at 2:39 PM, Chuck Reeves wrote: > /agree which was why I thought this was deprecated. I guess since the > webserver knows what parser to pull based off the file extension, it looks > as if Zend has decided that there would be no benefit to deprecating this > directive. > If you're using file extensions to parse, which I think most people are, then that still does not solve this problem: Works fine, and as expected, on servers without short_open_tags turned on. With them turned on, you have to wrote: > Which makes it seem like the obvious fix is to parse not parse > Back when I still thought it was fun to write XHTML, I used to do this > in my templates: > '?> > > Nice, huh? > It's snippets like these, imho, that justify the deprecation/removal of short open tags. From randalrust at gmail.com Fri Aug 28 15:41:10 2009 From: randalrust at gmail.com (Randal Rust) Date: Fri, 28 Aug 2009 15:41:10 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <236c3b210908281211s633fbe4eid4745182537f4c2a@mail.gmail.com> References: <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> <236c3b210908281211s633fbe4eid4745182537f4c2a@mail.gmail.com> Message-ID: On Fri, Aug 28, 2009 at 3:11 PM, Petros Ziogas wrote: > That were some good ideas about the problems that I thought will arise. Actually, everyone has had very good thoughts on the entire process. Enough for me to attempt to develop a solution, but also enough to know that it will not be a _perfect_ solution. -- Randal Rust R.Squared Communications www.r2communications.com 614-370-0036 From chsnyder at gmail.com Fri Aug 28 15:50:30 2009 From: chsnyder at gmail.com (Chris Snyder) Date: Fri, 28 Aug 2009 15:50:30 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> Message-ID: On Fri, Aug 28, 2009 at 3:33 PM, Eddie Drapkin wrote: > It's snippets like these, imho, that justify the deprecation/removal > of short open tags. Well, everyone is entitled to their opinion. I'd much rather type than . It all comes down to what you're used to. If you use php as a template language, short tags are an incredibly useful and valuable feature. If you don't, you probably think "ugh, that doesn't look like php." On the other hand, if I ever have to hack the php source to enable short tags, I'll change them to [; and ;] so I can stop wearing down my pinkie on the shift key. From lists at zaunere.com Fri Aug 28 15:56:20 2009 From: lists at zaunere.com (Hans Zaunere) Date: Fri, 28 Aug 2009 15:56:20 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> Message-ID: <016601ca2819$9d14cd00$d73e6700$@com> > > It's snippets like these, imho, that justify the deprecation/removal > > of short open tags. ... > On the other hand, if I ever have to hack the php source to enable > short tags, I'll change them to [; and ;] so I can stop wearing down > my pinkie on the shift key. Absolutely, some type of shorthand is needed, which is exactly why they exist in the first place. I think the issue with removing References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> <016601ca2819$9d14cd00$d73e6700$@com> Message-ID: <4A983ABB.6010503@devonianfarm.com> Hans Zaunere wrote: > > Absolutely, some type of shorthand is needed, which is exactly why they > exist in the first place. I think the issue with removing one could decide what to actually replace it with. It'll come, wait for > it... > > Well you're at it, how about a version of in my templates so I'm not writing hundreds of HTML injection bugs all day.. From chuck.reeves at gmail.com Fri Aug 28 16:45:01 2009 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Fri, 28 Aug 2009 16:45:01 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> <236c3b210908281211s633fbe4eid4745182537f4c2a@mail.gmail.com> Message-ID: On more solution would be to have a roll over the word/phrase that will present the user with a list of articles matching that title. This way for the Americas problem, the user can then choose which article s/he would like to goto instead of letting the system decide for them. This will make they feel more empowered and smarter. Thank You Chuck Reeves Cell: 631-374-0772 Email: chuck.reeves at gmail.com On Fri, Aug 28, 2009 at 3:41 PM, Randal Rust wrote: > On Fri, Aug 28, 2009 at 3:11 PM, Petros Ziogas > wrote: > > > That were some good ideas about the problems that I thought will arise. > > Actually, everyone has had very good thoughts on the entire process. > Enough for me to attempt to develop a solution, but also enough to > know that it will not be a _perfect_ solution. > > -- > Randal Rust > R.Squared Communications > www.r2communications.com > 614-370-0036 > _______________________________________________ > 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 Sat Aug 29 05:07:57 2009 From: justin at justinhileman.info (Justin Hileman) Date: Sat, 29 Aug 2009 05:07:57 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <4A983ABB.6010503@devonianfarm.com> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> <016601ca2819$9d14cd00$d73e6700$@com> <4A983ABB.6010503@devonianfarm.com> Message-ID: <4A98EFED.6090408@justinhileman.info> Paul A Houle wrote: > > It might be an irresponsible namespace grab, but I've got a > function that is (almost) > > function Q($s) { echo htmlspecialchars($s) }; > > and I get into the habit of writing in my > templates so I'm not writing hundreds of HTML injection bugs all day.. For bonus points, I'm a fan of something this: function _($string) { echo htmlspecialchars(l10n($string)); } Then does double duty: it escapes what you need to escape, and runs the string through a localization lookup function or table. -- justin http://justinhileman.com From tedd at sperling.com Sat Aug 29 08:53:44 2009 From: tedd at sperling.com (tedd) Date: Sat, 29 Aug 2009 08:53:44 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> Message-ID: At 3:50 PM -0400 8/28/09, Chris Snyder wrote: >On Fri, Aug 28, 2009 at 3:33 PM, Eddie Drapkin wrote: > >> It's snippets like these, imho, that justify the deprecation/removal >> of short open tags. > >Well, everyone is entitled to their opinion. I'd much rather type > than . > >It all comes down to what you're used to. No, I don't think so. I write code so that the next programmer who reviews my work can do so easily. Making code cryptic does absolutely nothing but cause problems for others. It doesn't mean you're a clever programmer, it just means that you don't know any better. Also, short tags don't work well with xml and another reason for depreciating them. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Sat Aug 29 10:03:45 2009 From: tedd at sperling.com (tedd) Date: Sat, 29 Aug 2009 10:03:45 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: <236c3b210908281211s633fbe4eid4745182537f4c2a@mail.gmail.com> References: <3BB77631-7343-4FDA-BB64-AA09F64D1A11@mac.com> <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> <236c3b210908281211s633fbe4eid4745182537f4c2a@mail.gmail.com> Message-ID: An HTML attachment was scrubbed... URL: From tedd at sperling.com Sat Aug 29 10:22:14 2009 From: tedd at sperling.com (tedd) Date: Sat, 29 Aug 2009 10:22:14 -0400 Subject: [nycphp-talk] Dynamically Add Links to Text In-Reply-To: References: <4A96E81F.7060507@nyphp.com> <236c3b210908280300j672979e1n7a637cbe349ec3bc@mail.gmail.com> <236c3b210908281211s633fbe4eid4745182537f4c2a@mail.gmail.com> Message-ID: At 4:45 PM -0400 8/28/09, Chuck Reeves wrote: >On more solution would be to have a roll over the word/phrase that >will present the user with a list of articles matching that title. >This way for the Americas problem, the user can then choose which >article s/he would like to goto instead of letting the system decide >for them. This will make they feel more empowered and smarter. Many years ago there was a company who made a devise that played chess -- it was table-top piece of hardware. The company found they had a large number of returns where the units had been obviously damaged by the users. They studied the problem and rewrote the algorithm to take more time to make the computer's move. As a result, they found that the incidence of repair dropped. It seems that the computer's move was too fast, which frustrated the players to the point of becoming violent. Slowing the computer down, gave the users a feeling that their move was worthy of timely consideration by the computer and thus lessened unfavorable user behavior. We need to remember that user interfacing is part of what we do. If the user doesn't understand the process, then they won't trust outcome-- and if they don't trust, then we need to get them in the decision process until they do. It's called human engineering. What complicated problems we find today, will have commonplace solutions tomorrow. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ajai at bitblit.net Sat Aug 29 12:05:32 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sat, 29 Aug 2009 12:05:32 -0400 (EDT) Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <016601ca2819$9d14cd00$d73e6700$@com> Message-ID: On Fri, 28 Aug 2009, Hans Zaunere wrote: > Absolutely, some type of shorthand is needed, which is exactly why they > exist in the first place. I think the issue with removing one could decide what to actually replace it with. It'll come, wait for > it... How about <% and %> - just like ASP :-))) -- Aj. From mona.borham at webworxcorp.com Sat Aug 29 13:07:55 2009 From: mona.borham at webworxcorp.com (Mona Borham) Date: Sat, 29 Aug 2009 20:07:55 +0300 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: <016601ca2819$9d14cd00$d73e6700$@com> Message-ID: the problem is the same if you are working in multiple language support in your hosting server Mona Web Developer On Sat, Aug 29, 2009 at 7:05 PM, Ajai Khattri wrote: > On Fri, 28 Aug 2009, Hans Zaunere wrote: > > > Absolutely, some type of shorthand is needed, which is exactly why they > > exist in the first place. I think the issue with removing no > > one could decide what to actually replace it with. It'll come, wait for > > it... > > How about <% and %> - just like ASP :-))) > > > > -- > Aj. > > _______________________________________________ > 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 ramons at gmx.net Sat Aug 29 14:35:51 2009 From: ramons at gmx.net (David Krings) Date: Sat, 29 Aug 2009 14:35:51 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> Message-ID: <4A997507.7090004@gmx.net> Chris Snyder wrote: > On Fri, Aug 28, 2009 at 3:33 PM, Eddie Drapkin wrote: > >> It's snippets like these, imho, that justify the deprecation/removal >> of short open tags. > > Well, everyone is entitled to their opinion. I'd much rather type > than . > Since I have an opinion as well I think it isn't unreasonable to require to use the 'long' tags. They are not that much longer (three characters more) and for those who use them often assigning a hot key for it in the editor used is probably a smart move as well. I use only the 'long' tags. Which short tag it is supposed to be is really like facing the task of designing a new car and debating where the air freshener goes. But people are creatures of habit, so I think nothing will change in the end. David From jcampbell1 at gmail.com Sat Aug 29 15:14:34 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Sat, 29 Aug 2009 15:14:34 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <4A98EFED.6090408@justinhileman.info> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> <016601ca2819$9d14cd00$d73e6700$@com> <4A983ABB.6010503@devonianfarm.com> <4A98EFED.6090408@justinhileman.info> Message-ID: <8f0676b40908291214v3f9fb292r2bad344e12f57c@mail.gmail.com> On Sat, Aug 29, 2009 at 5:07 AM, Justin Hileman wrote: > > For bonus points, I'm a fan of something this: > > function _($string) { echo htmlspecialchars(l10n($string)); } > Be careful... _() is already defined as an alias for gettext() I have a feeling that would cause a ton of compatibility issues. Some time ago, I looked at the magento source code, and they were using __(), which seems like a reasonable alternative. When internationalizing an app, you often need to write code like: printf(l10n('%s wants to be your friend'), htmlspecialchars($friend_name) ); It is handy to make your shortcut behave like printf when there is more than 1 argument. -John Campbell From lists at nopersonal.info Sat Aug 29 15:27:20 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 15:27:20 -0400 Subject: [nycphp-talk] OOP, Frameworks, ONLAMP, and NYPHP In-Reply-To: <086f01ca27ea$96e9b690$c4bd23b0$@com> References: <4A950762.6050000@reuel.net> <086f01ca27ea$96e9b690$c4bd23b0$@com> Message-ID: <4A998118.9050003@nopersonal.info> Hans Zaunere wrote: > Regarding PHundamentals, it's certainly been a great resource over the years > thanks to the time and effort put into it, and the quality/participation of > the list members. > > It has, obviously, stalled and become a bit outdated itself. Picking them > back up would be a great thing, although time obviously is always the most > scarce commodity. If someone would want to help picking them back up, it'd > be a great thing. > > And in fact with today's Web 2.0 facey-spaces and twitter-books, perhaps > even more value would come. As part of PHundamentals, we could also > construct an open source project to facilitate the PHundamentals process. > > We'd just need some people (far or near to NYC) to help out... takers? Hi Hans, I can't offer much in the way of expertise, but I can certainly offer my time. It's the least I can do considering what a great resource this list has been. The way I see it, helping out in some capacity would not only allow me to give back a little, but would also almost surely result in learning something new & useful. Please feel free to contact me directly if you feel I can make a useful contribution of some kind. Regards, Bev From lists at nopersonal.info Sat Aug 29 16:02:34 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 16:02:34 -0400 Subject: [nycphp-talk] Need help understanding NULL Message-ID: <4A99895A.7030702@nopersonal.info> I don't usually use NULL values for anything because no matter how much I read I can't figure out the purpose of it. So far this hasn't been a problem for me, but I figure it's going to trip me up sooner or later. I've read the NULL sections of the PHP & MySQL manuals and even tried googling for articles, but the concept of a ?a missing unknown value? makes my brain hurt. Can someone please, please, please attempt to explain--in the simplest terms possible--what the practical advantages/disadvantages of using it might be? Regards, Bev From matt at atopia.net Sat Aug 29 16:10:55 2009 From: matt at atopia.net (Matt Juszczak) Date: Sat, 29 Aug 2009 16:10:55 -0400 (EDT) Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A99895A.7030702@nopersonal.info> References: <4A99895A.7030702@nopersonal.info> Message-ID: Bev, This might potentially be wrong, but what I think of NULL is this. If something is NULL, then you don't know what it is. It could be empty, or it could be set. You just don't know. If something is empty, then you know it's empty. So if birthdate is set to '', then you know they have no birthdate. But if it's set to NULL, you don't know if they have one or not. Sort of how I use it sometimes, and MAY BE WRONG. So I would listen to what others have to say =) On Sat, 29 Aug 2009, lists at nopersonal.info wrote: > I don't usually use NULL values for anything because no matter how much > I read I can't figure out the purpose of it. So far this hasn't been a > problem for me, but I figure it's going to trip me up sooner or later. > > I've read the NULL sections of the PHP & MySQL manuals and even tried > googling for articles, but the concept of a ?a missing unknown value? > makes my brain hurt. Can someone please, please, please attempt to > explain--in the simplest terms possible--what the practical > advantages/disadvantages of using it might be? > > Regards, > Bev > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php From danielc at analysisandsolutions.com Sat Aug 29 16:20:48 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 29 Aug 2009 16:20:48 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A99895A.7030702@nopersonal.info> References: <4A99895A.7030702@nopersonal.info> Message-ID: <20090829202048.GA4026@panix.com> Hey Bev: > but the concept of a ???a missing unknown value??? > makes my brain hurt. Let's say you wrote a piece of software that asks users a set of questions. Before a user responds to a given question, its answer field is null. When they answer the question, its field gets assigned the actual value chosen by the user. When the user finishes, sometimes they have skipped some questions, so they will remain null. This is useful, in part, for statistical purposes, since the null record won't be added into averages, etc. For example, you had three surveys filled out. Two people actually filled in their ages (10 and 20), if you do an average when using nulls, you'll get an average age of 15. But if you use 0's instead of nulls, the average age will incorrectly be 10. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at nopersonal.info Sat Aug 29 16:26:40 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 16:26:40 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: References: <4A99895A.7030702@nopersonal.info> Message-ID: <4A998F00.7090504@nopersonal.info> Matt Juszczak wrote: > something is NULL, then you don't know what it is. It could be empty, > or it could be set. You just don't know. That's precise the part I can't seem to wrap my head around. > If something is empty, then you know it's empty. So if birthdate is set > to '', then you know they have no birthdate. But if it's set to NULL, > you don't know if they have one or not. Thanks for trying, Matt, but I still don't get the purpose of "knowing that you don't know" something, so to speak. *headdesk* Bev From lists at nopersonal.info Sat Aug 29 16:33:13 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 16:33:13 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <20090829202048.GA4026@panix.com> References: <4A99895A.7030702@nopersonal.info> <20090829202048.GA4026@panix.com> Message-ID: <4A999089.7090707@nopersonal.info> Daniel Convissor wrote: > This is useful, in part, for statistical purposes, since the null record > won't be added into averages, etc. For example, you had three surveys > filled out. Two people actually filled in their ages (10 and 20), if you > do an average when using nulls, you'll get an average age of 15. But if > you use 0's instead of nulls, the average age will incorrectly be 10. Dan, this is very helpful--thank you! The light bulb is starting to come on in my head now... If anyone else has practical examples, please don't hold back. Bev From dirn at dirnonline.com Sat Aug 29 16:41:57 2009 From: dirn at dirnonline.com (Andy Dirnberger) Date: Sat, 29 Aug 2009 16:41:57 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A999089.7090707@nopersonal.info> References: <4A99895A.7030702@nopersonal.info> <20090829202048.GA4026@panix.com> <4A999089.7090707@nopersonal.info> Message-ID: On Sat, Aug 29, 2009 at 4:33 PM, lists at nopersonal.info wrote: > > If anyone else has practical examples, please don't hold back. > Here's an example of one instance in which I use null. Before querying the database, I check to see if the result of the query has been cached. I call a function that will either return the value in the cache or null, either because the cache has expired or because it was never set. When I receive a return value other than null, I skip the database query. When null comes back, I query the database and update the cache. From ramons at gmx.net Sat Aug 29 16:42:14 2009 From: ramons at gmx.net (David Krings) Date: Sat, 29 Aug 2009 16:42:14 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A99895A.7030702@nopersonal.info> References: <4A99895A.7030702@nopersonal.info> Message-ID: <4A9992A6.2020501@gmx.net> lists at nopersonal.info wrote: > I don't usually use NULL values for anything because no matter how much > I read I can't figure out the purpose of it. So far this hasn't been a > problem for me, but I figure it's going to trip me up sooner or later. > > I've read the NULL sections of the PHP & MySQL manuals and even tried > googling for articles, but the concept of a ?a missing unknown value? > makes my brain hurt. Can someone please, please, please attempt to > explain--in the simplest terms possible--what the practical > advantages/disadvantages of using it might be? I struggled with it for some time as well, because for non-programmers nothing, empty, null, nada, and nichts are the same thing. I think the easiest way to get an idea is to look at how strings and integers are stored in a database table. Unless a default value is specified, the contents of a field in a database table are set to NULL. That NULL isn't the same as zero for an integer. Zero is a defined value of an integer variable the same way 1 or 123456 would be. In case of strings, NULL is not the same as an empty string. So when you read records from a table and then use the field values to make comparisons you will find that NULL is unequal to zero or an empty string. While NULL is really nothing, 0 and "" are something - at least for a database and PHP, because then the database and PHP know exactly what is meant, whereas with NULL there is no defined value. Same way the other way around. Let's say, you create a simple ledger application to balance your checkbook. You have 100$ and spend it all on PHP books. So after entering the expense you end up with 0$, which is an explicit amount and the result of your calculation. NULL is not specific and if you do the math you get zero and not 'nothing'. In regards to strings, let's say you have a string and you need to strip all vowels and all occurrences of "s". The original string is "sea", not you strip the characters out and you get "". Similar to the math task above, it is a definitive results, whereas NULL isn't. That said, I think it is very important to initialize every variable you use in your script right at the beginning of the script, even if you never will use the variable with that value. The reason for that is that all your variables will have a definitive value. Same applies for variables that get values assigned that come from database tables or HTML forms (or better to say, any source no matter what). First order of business is to check it for being a NULL value and assigning it a definitive (explicit) value, which can include 0 or "". Otherwise PHP will complain or in case of integers just assume something. Typically, that is 0, but I rather tell PHP what it is than have PHP pull something out of its lower torso. Sure, one could say that NULL is the same as 0 or "", but that is a purely arbitrary interpretation, although maybe a convenient one. I hope I explained it in an understandable way. David From ka at kacomputerconsulting.com Sat Aug 29 16:47:09 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Sat, 29 Aug 2009 13:47:09 -0700 Subject: [nycphp-talk] Need help understanding NULL Message-ID: <1251578829.5291@coral.he.net> Bev, The test for and behavior of NULL varies somewhat from language to language and database to database. Let's take a basic example, you design a database table and you describe your LastName field as NOT NULL. That means that every time you do an insert into the table, the field LastName MUST contain a value of some sort. The purpose of that is basically to ensure that any query, unless it contains all of the required values, will error out if you attempt to do the insert without having a value in that field. In most cases, not all cases, on INSERT, an empty string i.e. '' is not considered a NULL value, but an empty string which will result in ... well...an empty string being stored in your database, but the field will not show as NULL. When you pull that out of the database, some languages will treat that as a NULL value and some will treat it as an empty string. Or, in your database, you can specify NULL as the default value for the field, and therefore if you skip it in an insert, it will default to NULL. The design of the database depends on the needs of the application. As a test of how PHP treats NULL vs. empty strings with your database, Create values of NULL, ' ' (a string containing a space), '' (an empty string) and pull them out into variables and then you can begin to determine how, in your application, they are being treated. In most cases, you should see NULLs and empty strings look very similar...but not always. And the devil is definitely in the details, especially if your application is talking to other platforms that may handle these values differently. It can help you to understand NULL, if you contemplate the difference between an empty string '' and NULL. NULL is not a string because it's undetermined. But an empty string is a string that contains, well, nothing, but it is not NULL. Kristina > Matt Juszczak wrote: > > something is NULL, then you don't know what it is. It could be empty, > > or it could be set. You just don't know. > > That's precise the part I can't seem to wrap my head around. > > > If something is empty, then you know it's empty. So if birthdate is set > > to '', then you know they have no birthdate. But if it's set to NULL, > > you don't know if they have one or not. > > Thanks for trying, Matt, but I still don't get the purpose of "knowing > that you don't know" something, so to speak. > > *headdesk* > > Bev > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From ka at kacomputerconsulting.com Sat Aug 29 16:57:06 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Sat, 29 Aug 2009 13:57:06 -0700 Subject: [nycphp-talk] Need help understanding NULL Message-ID: <1251579426.6973@coral.he.net> David, Thanks for this, and I can't cut & paste and quote you because your email got encoded by my webmail. You're right that in PHP most of the comparison operators won't treat an empty string and NULL pulled out of a database as the same. I'm thinking back on a long history of using many languages and have to say that without sitting down and testing it out, I couldn't offhand make a list of what the behavior would be with, say, = vs == vs the new === in PHP5. Look forward to hearing more stuff! Kristina From ka at kacomputerconsulting.com Sat Aug 29 16:57:06 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Sat, 29 Aug 2009 13:57:06 -0700 Subject: [nycphp-talk] Need help understanding NULL Message-ID: <1251579426.6973@coral.he.net> David, Thanks for this, and I can't cut & paste and quote you because your email got encoded by my webmail. You're right that in PHP most of the comparison operators won't treat an empty string and NULL pulled out of a database as the same. I'm thinking back on a long history of using many languages and have to say that without sitting down and testing it out, I couldn't offhand make a list of what the behavior would be with, say, = vs == vs the new === in PHP5. Look forward to hearing more stuff! Kristina From lists at zaunere.com Sat Aug 29 18:21:50 2009 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 29 Aug 2009 18:21:50 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <4A983ABB.6010503@devonianfarm.com> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> <016601ca2819$9d14cd00$d73e6700$@com> <4A983ABB.6010503@devonianfarm.com> Message-ID: <00a801ca28f7$1b1f26e0$515d74a0$@com> > > Absolutely, some type of shorthand is needed, which is exactly why they > > exist in the first place. I think the issue with removing > one could decide what to actually replace it with. It'll come, wait for > > it... > > Well you're at it, how about a version of htmlspecialchars() built in... > > It might be an irresponsible namespace grab, but I've got a > function that is (almost) > > function Q($s) { echo htmlspecialchars($s) }; > > and I get into the habit of writing in my > templates so I'm not writing hundreds of HTML injection bugs all day.. Yeah something like this could be handy, certainly. I typically push/adapt an object into the template which is property overloaded. Then something like: FirstName?> Outputs correctly escaped (or processed in any other way depending on what the overload wants to do) content. Quite handy and has proved effective. It does seem that it'd be handy to have some type of "stdout" processing hook that can be overridden, while providing a shorthand for working in templates. Hmm... streams... wonder if that could do anything here as they are now... I'll have to look it up. H From lists at zaunere.com Sat Aug 29 18:37:18 2009 From: lists at zaunere.com (Hans Zaunere) Date: Sat, 29 Aug 2009 18:37:18 -0400 Subject: [nycphp-talk] OOP, Frameworks, ONLAMP, and NYPHP In-Reply-To: <4A998118.9050003@nopersonal.info> References: <4A950762.6050000@reuel.net> <086f01ca27ea$96e9b690$c4bd23b0$@com> <4A998118.9050003@nopersonal.info> Message-ID: <00b201ca28f9$43e04760$cba0d620$@com> > > Regarding PHundamentals, it's certainly been a great resource over the years > > thanks to the time and effort put into it, and the quality/participation of > > the list members. > > > > It has, obviously, stalled and become a bit outdated itself. Picking them > > back up would be a great thing, although time obviously is always the most > > scarce commodity. If someone would want to help picking them back up, it'd > > be a great thing. > > > > And in fact with today's Web 2.0 facey-spaces and twitter-books, perhaps > > even more value would come. As part of PHundamentals, we could also > > construct an open source project to facilitate the PHundamentals process. > > > > We'd just need some people (far or near to NYC) to help out... takers? > Hi Hans, Hi Bev, > I can't offer much in the way of expertise, but I can certainly offer my > time. It's the least I can do considering what a great resource this > list has been. The way I see it, helping out in some capacity would not > only allow me to give back a little, but would also almost surely result > in learning something new & useful. Actually expertise isn't required... just time and organization :) For everyone's benefit, let me recap quickly how PHunnys have worked in the past. The original concept was to form articles based on mailing list/community feedback and sharing of experience. Perhaps it could be considered an early "crowdsourcing" before it became a buzzword. So the PHunnys editor would pose a question to the list, encourage discussion, ask for other opinions, and try to garner as much feedback/etc as possible. Then, build the responses into an article and post it online. Originally, the purpose was to form best practices articles, but I could see this expanding - for instance, to include a general tally/poll/listing of people's techniques, and pros/cons of each (rather than just a single best practice). Take for instance the recent/ongoing discussion about short tags and server settings. A lot of good information has travelled the list because of these threads, and the PHunny editor would combine these into an article. The topics of discussion would also be "crowd sourced" and I have a listing somewhere of some topics we had considered covering in the past. > Please feel free to contact me directly if you feel I can make a useful > contribution of some kind. Thanks again Bev, I'll also follow-up with you directly as well. I also encourage anyone else who might be interested in participating, to join the Org list - we can continue general organizational discussion over there. Best, H From lists at nopersonal.info Sat Aug 29 18:59:55 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 18:59:55 -0400 Subject: [nycphp-talk] OOP, Frameworks, ONLAMP, and NYPHP In-Reply-To: <00b201ca28f9$43e04760$cba0d620$@com> References: <4A950762.6050000@reuel.net> <086f01ca27ea$96e9b690$c4bd23b0$@com> <4A998118.9050003@nopersonal.info> <00b201ca28f9$43e04760$cba0d620$@com> Message-ID: <4A99B2EB.4010606@nopersonal.info> Hans Zaunere wrote: >> I can't offer much in the way of expertise, but I can certainly offer my >> time. It's the least I can do considering what a great resource this >> list has been. The way I see it, helping out in some capacity would not >> only allow me to give back a little, but would also almost surely result >> in learning something new & useful. > > Actually expertise isn't required... just time and organization :) > > For everyone's benefit, let me recap quickly how PHunnys have worked in the > past.... > I also encourage anyone else who might be interested in participating, to > join the Org list - we can continue general organizational discussion over > there. Hans, this sounds great. Your other email just came in, so I'm going to sign up for the Org list and then I'll read through what you sent. Regards, Bev From tedd at sperling.com Sat Aug 29 19:30:12 2009 From: tedd at sperling.com (tedd) Date: Sat, 29 Aug 2009 19:30:12 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A999089.7090707@nopersonal.info> References: <4A99895A.7030702@nopersonal.info> <20090829202048.GA4026@panix.com> <4A999089.7090707@nopersonal.info> Message-ID: At 4:33 PM -0400 8/29/09, lists at nopersonal.info wrote: >Daniel Convissor wrote: >> This is useful, in part, for statistical purposes, since the null record >> won't be added into averages, etc. For example, you had three surveys >> filled out. Two people actually filled in their ages (10 and 20), if you >> do an average when using nulls, you'll get an average age of 15. But if >> you use 0's instead of nulls, the average age will incorrectly be 10. > >Dan, this is very helpful--thank you! The light bulb is starting to come >on in my head now... > >If anyone else has practical examples, please don't hold back. > >Bev Null is an odd critter. It's not an empty string, it's not '', it's not 0, it's NULL. Try reading this: http://dev.mysql.com/doc/refman/5.0/en/problems-with-null.html Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From lists at nopersonal.info Sat Aug 29 19:31:51 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 19:31:51 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: References: <4A99895A.7030702@nopersonal.info> <20090829202048.GA4026@panix.com> <4A999089.7090707@nopersonal.info> Message-ID: <4A99BA67.7040401@nopersonal.info> Andy Dirnberger wrote: > Before querying the database, I check to see if the result of the > query has been cached. I call a function that will either return the > value in the cache or null, either because the cache has expired or > because it was never set. When I receive a return value other than > null, I skip the database query. When null comes back, I query the > database and update the cache. Andy, thanks a bunch for the example. Bev From lists at nopersonal.info Sat Aug 29 20:21:43 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 20:21:43 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9992A6.2020501@gmx.net> References: <4A99895A.7030702@nopersonal.info> <4A9992A6.2020501@gmx.net> Message-ID: <4A99C617.6060106@nopersonal.info> David, thanks for the detailed explanation & examples. David Krings wrote: > That said, I think it is very important to initialize every variable you > use in your script right at the beginning of the script, even if you > never will use the variable with that value. The reason for that is that > all your variables will have a definitive value. Same applies for > variables that get values assigned that come from database tables or > HTML forms (or better to say, any source no matter what). First order of > business is to check it for being a NULL value and assigning it a > definitive (explicit) value, which can include 0 or "". Otherwise PHP > will complain or in case of integers just assume something. Typically, > that is 0, but I rather tell PHP what it is than have PHP pull something > out of its lower torso. Okay, wait--but what about what Dan said re NULL values not being added to averages, making them useful statistically? In that case wouldn't you want NULL to stay NULL? IOW, in his case the query would would only retrieve values WHERE foo != NULL? But then the manual says that the arithmetic comparison operators won't work with NULL, so that can't be right... Hang on, let me think a minute... Okay, so then I guess you'd just assign a value of 0 or '' to anything that was NULL, and then have PHP only calculate numbers where $foo >= 1? But if that's the case, then why use NULL in the first place? That can't be right, so I must still be missing some important point. One last try: Maybe the query would be along the lines of SELECT * WHERE foo NOT IN NULL, that way there wouldn't be any need to deal with it because since it was never retrieved in the first place...? Sorry for making you witness my somewhat scattershot thinking process, but even the smallest sequences of programming logic can still be a big challenge for me. > Sure, one could say that NULL is the same as 0 or "", but that is a > purely arbitrary interpretation, although maybe a convenient one. Got it. > I hope I explained it in an understandable way. You did an awesome job of explaining. Thanks again for taking the time to help. From lists at nopersonal.info Sat Aug 29 21:11:34 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 21:11:34 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <1251578829.5291@coral.he.net> References: <1251578829.5291@coral.he.net> Message-ID: <4A99D1C6.8020606@nopersonal.info> Kristina D. H. Anderson wrote: > Let's take a basic example, you design a database table and you > describe your LastName field as NOT NULL. > > That means that every time you do an insert into the table, the field > LastName MUST contain a value of some sort. The purpose of that is > basically to ensure that any query, unless it contains all of the > required values, will error out if you attempt to do the insert without > having a value in that field. But in the case of a form, wouldn't you be validating the input before trying to insert the record? Sorry if I seem dense--I must be misunderstanding something. > In most cases, not all cases, on INSERT, an empty string i.e. '' is not > considered a NULL value, but an empty string which will result in ... > well...an empty string being stored in your database, but the field > will not show as NULL. When you pull that out of the database, some > languages will treat that as a NULL value and some will treat it as an > empty string. > > Or, in your database, you can specify NULL as the default value for the > field, and therefore if you skip it in an insert, it will default to > NULL. The design of the database depends on the needs of the > application. This is really good to know. I guess that answers my previous question above. :) > As a test of how PHP treats NULL vs. empty strings with your database, > > Create values of NULL, ' ' (a string containing a space), '' (an empty > string) and pull them out into variables and then you can begin to > determine how, in your application, they are being treated. Now that you guys have given me a better understanding of things, I'm going to do exactly as you suggested--create a table with some NULL values and try playing around to see what happens. > In most cases, you should see NULLs and empty strings look very > similar...but not always. And the devil is definitely in the details, Yes, the devil is definitely in the details. I can't tell you how many times I've lost a night's sleep over something small. For me, it usually has to do with logic/sequence, but sometimes it's something really stupid like: Creating a field/variable named desc and spending hours trying to figure out why MySQL was balking at my query with its typically enigmatic error messages. When it finally dawned on me what my mistake was I think I invented some entirely new curse words just for that occasion! LOL Or like the time (very recently) when I was converting timestamps to calculate the number of days between two given dates. I used the number_format() function so the number of days display nicely to the user, but then couldn't figure out why records with more than 999 weren't behaving properly (they were supposed to show up in different colors as expiration dates approached, and notices of pending expirations were also to be emailed). I checked, doubled checked, and triple checked my math because numbers are not my friends, but I couldn't find anything wrong. The problem? The comma that number_format() was inserting. Duh. Once I switched to using the round() and restricted using number_format() only to display things at the end after all calculations had been done, everything was just fine. > especially if your application is talking to other platforms that may > handle these values differently. Again, very good to know. > It can help you to understand NULL, if you contemplate the difference > between an empty string '' and NULL. NULL is not a string because it's > undetermined. But an empty string is a string that contains, well, > nothing, but it is not NULL. Got it. Thanks for your help, Kristina. Bev From lists at nopersonal.info Sat Aug 29 21:26:05 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 21:26:05 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: References: <4A99895A.7030702@nopersonal.info> <20090829202048.GA4026@panix.com> <4A999089.7090707@nopersonal.info> Message-ID: <4A99D52D.6040307@nopersonal.info> tedd wrote: > Null is an odd critter. Indeed. > Try reading this: > > http://dev.mysql.com/doc/refman/5.0/en/problems-with-null.html Actually, that's precisely what I was reading before I posted here. I had once again been trying to comprehend NULL and had hoped that rereading the manual pages would make more sense this time around as that sometimes works when I get a little more experience with things. Unfortunately, my efforts were to no avail. There's something about the way most manual pages are written that tends to make my eyes glaze over in about 60 seconds flat. Regards, Bev From michael.southwell at nyphp.com Sat Aug 29 21:56:00 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Sat, 29 Aug 2009 21:56:00 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <1251579426.6973@coral.he.net> References: <1251579426.6973@coral.he.net> Message-ID: <4A99DC30.4010105@nyphp.com> Kristina D. H. Anderson wrote: > You're right that in PHP most of the comparison operators won't treat > an empty string and NULL pulled out of a database as the same. I'm > thinking back on a long history of using many languages and have to say > that without sitting down and testing it out, I couldn't offhand make a > list of what the behavior would be with, say, = vs == vs the new === in > PHP5. Precisely this issue is discussed in the PHundamental article http://www.nyphp.org/phundamentals/variableevaluation.php (which picks up a contemporaneous thread ;-). -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From jcampbell1 at gmail.com Sat Aug 29 22:00:45 2009 From: jcampbell1 at gmail.com (John Campbell) Date: Sat, 29 Aug 2009 22:00:45 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A99D1C6.8020606@nopersonal.info> References: <1251578829.5291@coral.he.net> <4A99D1C6.8020606@nopersonal.info> Message-ID: <8f0676b40908291900p53e6696l8ef0c7514b1bdf25@mail.gmail.com> You should be aware that PHP and SQL have completely different concepts of null. In php, null is a unique magic value that means "undefined", and if two things are null, then they are equal. >>But in the case of a form, wouldn't you be validating the input before >>trying to insert the record? Sorry if I seem dense--I must be >>misunderstanding something. No, you are exactly right, and you'll want to use a combination of client-side (form) validation and good database design, and make decisions based on the individual application. But, you also need to be aware of other people's database design choices, and code around them. It's good to know that a blank string is not null when you need to populate a field that is supposed to be NOT NULL but actually has no value to be inserted...and that sounds insane, but I've seen stuff like this over the years, and sometimes it cannot be changed but only dealt with. :) Also sometimes you're not dealing with forms, let's say you have a web service that's sending you XML which gets processed and goes right into the database without your ever seeing it in the production environment (and this is getting more and more common these days, and there is just nobody sitting around reading a generated log of every response that comes in to check them, like I suggested you do in a test environment...that defeats the purpose of automatically inserting the data!), so the best way you're able to generate an error if fields are missing is if the query doesn't execute...this can happen, say, if the people sending you the data change something and don't bother to notify you...if your fields in the database will accept NULL inputs, you could look a week later and see missing data...there are a lot of different cases and all the solutions are different. Kristina > Kristina D. H. Anderson wrote: > > Let's take a basic example, you design a database table and you > > describe your LastName field as NOT NULL. > > > > That means that every time you do an insert into the table, the field > > LastName MUST contain a value of some sort. The purpose of that is > > basically to ensure that any query, unless it contains all of the > > required values, will error out if you attempt to do the insert without > > having a value in that field. > > But in the case of a form, wouldn't you be validating the input before > trying to insert the record? Sorry if I seem dense--I must be > misunderstanding something. > > > In most cases, not all cases, on INSERT, an empty string i.e. '' is not > > considered a NULL value, but an empty string which will result in ... > > well...an empty string being stored in your database, but the field > > will not show as NULL. When you pull that out of the database, some > > languages will treat that as a NULL value and some will treat it as an > > empty string. > > > > Or, in your database, you can specify NULL as the default value for the > > field, and therefore if you skip it in an insert, it will default to > > NULL. The design of the database depends on the needs of the > > application. > > This is really good to know. I guess that answers my previous question > above. :) > > > As a test of how PHP treats NULL vs. empty strings with your database, > > > > Create values of NULL, ' ' (a string containing a space), '' (an empty > > string) and pull them out into variables and then you can begin to > > determine how, in your application, they are being treated. > > Now that you guys have given me a better understanding of things, I'm > going to do exactly as you suggested--create a table with some NULL > values and try playing around to see what happens. > > > In most cases, you should see NULLs and empty strings look very > > similar...but not always. And the devil is definitely in the details, > > Yes, the devil is definitely in the details. I can't tell you how many > times I've lost a night's sleep over something small. For me, it usually > has to do with logic/sequence, but sometimes it's something really > stupid like: > > Creating a field/variable named desc and spending hours trying to figure > out why MySQL was balking at my query with its typically enigmatic error > messages. When it finally dawned on me what my mistake was I think I > invented some entirely new curse words just for that occasion! LOL > > Or like the time (very recently) when I was converting timestamps to > calculate the number of days between two given dates. I used the > number_format() function so the number of days display nicely to the > user, but then couldn't figure out why records with more than 999 > weren't behaving properly (they were supposed to show up in different > colors as expiration dates approached, and notices of pending > expirations were also to be emailed). I checked, doubled checked, and > triple checked my math because numbers are not my friends, but I > couldn't find anything wrong. The problem? The comma that > number_format() was inserting. Duh. Once I switched to using the round () > and restricted using number_format() only to display things at the end > after all calculations had been done, everything was just fine. > > > especially if your application is talking to other platforms that may > > handle these values differently. > > Again, very good to know. > > > It can help you to understand NULL, if you contemplate the difference > > between an empty string '' and NULL. NULL is not a string because it's > > undetermined. But an empty string is a string that contains, well, > > nothing, but it is not NULL. > > Got it. Thanks for your help, Kristina. > > Bev > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From lists at nopersonal.info Sat Aug 29 22:16:26 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 22:16:26 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <8f0676b40908291900p53e6696l8ef0c7514b1bdf25@mail.gmail.com> References: <1251578829.5291@coral.he.net> <4A99D1C6.8020606@nopersonal.info> <8f0676b40908291900p53e6696l8ef0c7514b1bdf25@mail.gmail.com> Message-ID: <4A99E0FA.8030309@nopersonal.info> John Campbell wrote: > You should be aware that PHP and SQL have completely different concepts of null. > > In php, null is a unique magic value that means "undefined", and if > two things are null, then they are equal. > In a SQL view of the world, that can be interpreted as: > Are two not yet known values equal? > and the answer is: > "Not yet known" > > In sql, every comparison to NULL, yields another NULL. > That is why 'SELECT * WHERE foo = NULL' doesn't do what you might > expect. In fact that query is guaranteed to always return zero rows. OMG, having this info solves a big piece of the puzzle for me--thank you! > It is a fact of life that pretty much every language handles NULL > differently, and whenever I learn a new language, it is one of the > first things I research. I'll keep that in mind. Bev From michael.southwell at nyphp.com Sat Aug 29 22:17:56 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Sat, 29 Aug 2009 22:17:56 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <8f0676b40908291900p53e6696l8ef0c7514b1bdf25@mail.gmail.com> References: <1251578829.5291@coral.he.net> <4A99D1C6.8020606@nopersonal.info> <8f0676b40908291900p53e6696l8ef0c7514b1bdf25@mail.gmail.com> Message-ID: <4A99E154.7030205@nyphp.com> John Campbell wrote: > In sql, every comparison to NULL, yields another NULL. > That is why 'SELECT * WHERE foo = NULL' doesn't do what you might > expect. In fact that query is guaranteed to always return zero rows. which is why the correct syntax for such a select would have to be 'SELECT * [FROM table] WHERE foo IS NULL' rather than '= NULL' -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth From ka at kacomputerconsulting.com Sat Aug 29 22:31:44 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Sat, 29 Aug 2009 19:31:44 -0700 Subject: [nycphp-talk] Need help understanding NULL Message-ID: <1251599504.29855@coral.he.net> The fun part is when you inherit a database that's such a mess that your "empty" fields are either NULLs, or ''s, OR even ' 's. And of course all the boolean fields use 0 for true and 1 for false...just to really make your day. Real-world programming scenarios!! Kristina > John Campbell wrote: > > In sql, every comparison to NULL, yields another NULL. > > That is why 'SELECT * WHERE foo = NULL' doesn't do what you might > > expect. In fact that query is guaranteed to always return zero rows. > > which is why the correct syntax for such a select would have to be > 'SELECT * [FROM table] WHERE foo IS NULL' rather than '= NULL' > > > -- > ================= > 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 > > From lists at nopersonal.info Sat Aug 29 23:09:11 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 23:09:11 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <1251598145.24962@coral.he.net> References: <1251598145.24962@coral.he.net> Message-ID: <4A99ED57.3060309@nopersonal.info> Kristina D. H. Anderson wrote: >>> But in the case of a form, wouldn't you be validating the input before >>> trying to insert the record? Sorry if I seem dense--I must be >>> misunderstanding something. > > No, you are exactly right, and you'll want to use a combination of > client-side (form) validation and good database design, and make > decisions based on the individual application. But, you also need to > be aware of other people's database design choices, and code around > them. It's good to know that a blank string is not null when you need > to populate a field that is supposed to be NOT NULL but actually has no > value to be inserted...and that sounds insane, but I've seen stuff like > this over the years, and sometimes it cannot be changed but only dealt > with. :) Ah, okay, I see your point now. > Also sometimes you're not dealing with forms, let's say you have a web > service that's sending you XML which gets processed and goes right into > the database without your ever seeing it in the production environment > (and this is getting more and more common these days, and there is just > nobody sitting around reading a generated log of every response that > comes in to check them, like I suggested you do in a test > environment...that defeats the purpose of automatically inserting the > data!), so the best way you're able to generate an error if fields are > missing is if the query doesn't execute...this can happen, say, if the > people sending you the data change something and don't bother to notify > you...if your fields in the database will accept NULL inputs, you could > look a week later and see missing data...there are a lot of different > cases and all the solutions are different. That makes perfect sense in the situation you describe. *wonders if this programming stuff is ever going to get easier* Bev ;) From danielc at analysisandsolutions.com Sat Aug 29 23:16:16 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 29 Aug 2009 23:16:16 -0400 Subject: [nycphp-talk] naming identifiers (was: understanding NULL) In-Reply-To: <4A99D1C6.8020606@nopersonal.info> References: <1251578829.5291@coral.he.net> <4A99D1C6.8020606@nopersonal.info> Message-ID: <20090830031616.GA10697@panix.com> Hi Bev: > Creating a field/variable named desc and spending hours trying to figure > out why MySQL was balking at my query with its typically enigmatic error > messages. Your big mistake was delimiting the identifiers when creating the table. "Identifiers" are table names, field names, index names, etc. The "delimiter" for these is "`" in MySQL. When you use the delimiter around the identifiers, the database allows you to create nearly any name you can possibly think of, including "reserved words." Reserved words are, well words that the system has reserved for its own internal use, so should not be utilized by users. As you've now discovered, delimiting identifiers when creating tables is the genesis of a world of pain. If you tried to create a table with a name called "desc" in it without delimiting it, MySQL would have complained to you up front, saving you the agony. > Or like the time (very recently) when I was converting timestamps to > calculate the number of days between two given dates. I used the > number_format() function... Uh, just making sure... Did you convert the timestamps via number_format() then do the math? Ouch. This is the kind of stuff the date functions, like date_diff(), etc, in MySQL and PHP are for. Faster, more accurate, easier. Then format the result. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From ka at kacomputerconsulting.com Sat Aug 29 23:23:29 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Sat, 29 Aug 2009 20:23:29 -0700 Subject: [nycphp-talk] naming identifiers (was: understanding NULL) Message-ID: <1251602609.5415@coral.he.net> >Your big mistake was delimiting the identifiers when creating the table. > > "Identifiers" are table names, field names, index names, etc. The > "delimiter" for these is "`" in MySQL. When you use the delimiter around > the identifiers, the database allows you to create nearly any name you > can possibly think of, including "reserved words." Reserved words are, > well words that the system has reserved for its own internal use, so > should not be utilized by users. This cannot possibly be stated often enough. Kristina > Hi Bev: > > > Creating a field/variable named desc and spending hours trying to figure > > out why MySQL was balking at my query with its typically enigmatic error > > messages. > > Your big mistake was delimiting the identifiers when creating the table. > > "Identifiers" are table names, field names, index names, etc. The > "delimiter" for these is "`" in MySQL. When you use the delimiter around > the identifiers, the database allows you to create nearly any name you > can possibly think of, including "reserved words." Reserved words are, > well words that the system has reserved for its own internal use, so > should not be utilized by users. As you've now discovered, delimiting > identifiers when creating tables is the genesis of a world of pain. > > If you tried to create a table with a name called "desc" in it without > delimiting it, MySQL would have complained to you up front, saving you > the agony. > > > > Or like the time (very recently) when I was converting timestamps to > > calculate the number of days between two given dates. I used the > > number_format() function... > > Uh, just making sure... Did you convert the timestamps via > number_format() then do the math? Ouch. This is the kind of stuff the > date functions, like date_diff(), etc, in MySQL and PHP are for. > Faster, more accurate, easier. Then format the result. > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From lists at nopersonal.info Sat Aug 29 23:33:33 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sat, 29 Aug 2009 23:33:33 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A99DC30.4010105@nyphp.com> References: <1251579426.6973@coral.he.net> <4A99DC30.4010105@nyphp.com> Message-ID: <4A99F30D.6080002@nopersonal.info> Michael Southwell wrote: > Precisely this issue is discussed in the PHundamental article > http://www.nyphp.org/phundamentals/variableevaluation.php (which picks > up a contemporaneous thread ;-). Wow, that's a great article. I don't know how I overlooked it. Bev From danielc at analysisandsolutions.com Sat Aug 29 23:57:35 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sat, 29 Aug 2009 23:57:35 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <8f0676b40908291900p53e6696l8ef0c7514b1bdf25@mail.gmail.com> References: <1251578829.5291@coral.he.net> <4A99D1C6.8020606@nopersonal.info> <8f0676b40908291900p53e6696l8ef0c7514b1bdf25@mail.gmail.com> Message-ID: <20090830035735.GA2118@panix.com> Heya: > In sql, every comparison to NULL, yields another NULL. > That is why 'SELECT * WHERE foo = NULL' doesn't do what you might > expect. In fact that query is guaranteed to always return zero rows. When you want to get rows where foo really is null, you need to need to use "is null": SELECT * WHERE foo IS NULL; --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at zaunere.com Sun Aug 30 00:02:30 2009 From: lists at zaunere.com (Hans Zaunere) Date: Sun, 30 Aug 2009 00:02:30 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A99895A.7030702@nopersonal.info> References: <4A99895A.7030702@nopersonal.info> Message-ID: <017b01ca2926$b203ccd0$160b6670$@com> > I don't usually use NULL values for anything because no matter how much > I read I can't figure out the purpose of it. So far this hasn't been a > problem for me, but I figure it's going to trip me up sooner or later. NULL is just a type - a type that can only ever be one thing - NULL > I've read the NULL sections of the PHP & MySQL manuals and even tried > googling for articles, but the concept of a ?a missing unknown value? > makes my brain hurt. Can someone please, please, please attempt to > explain--in the simplest terms possible--what the practical > advantages/disadvantages of using it might be? NULL comes from pointers, largely where there can be null references or pointers. It's an address that doesn't point anywhere, but is some way pointed to and acknowledged, thus it's not purely non-existent (yes, we could argue for years on the subtle meanings of NULL, void, undefined, etc. :) As always, there's only one real resource these days: http://en.wikipedia.org/wiki/Null To me, pragmatically, NULL really only comes down to one thing - it's a special type that always has a single value. Different languages and environments then utilize this type differently, and add their own meanings. Thus you need to read the different environment's docs to learn how NULL is treated specifically in that environment, and how it affects getting things down in that environment. There is no "global" real meaning of NULL - it's language specific. Other than that NULL is meaningless - it's NULL :) H From danielc at analysisandsolutions.com Sun Aug 30 00:05:43 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 30 Aug 2009 00:05:43 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <1251598145.24962@coral.he.net> References: <1251598145.24962@coral.he.net> Message-ID: <20090830040543.GB2118@panix.com> Folks: On Sat, Aug 29, 2009 at 07:09:05PM -0700, Kristina D. H. Anderson wrote: > >>But in the case of a form, wouldn't you be validating the input before > >>trying to insert the record? Sorry if I seem dense--I must be > >>misunderstanding something. > > No, you are exactly right, and you'll want to use a combination of > client-side (form) validation and good database design Client side validation is only good for helping the user not make mistakes. Server side validation/escaping/prepared statements is required for security reasons. > Also sometimes you're not dealing with forms, let's say you have a web > service that's sending you XML which gets processed and goes right into > the database ... > so the best way you're able to generate an error if fields are > missing is if the query doesn't execute. For some value of "best." It's generally nicer to validate the XML against a schema file using DOMDocument::schemaValidate(). --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From ramons at gmx.net Sun Aug 30 00:33:10 2009 From: ramons at gmx.net (David Krings) Date: Sun, 30 Aug 2009 00:33:10 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A99C617.6060106@nopersonal.info> References: <4A99895A.7030702@nopersonal.info> <4A9992A6.2020501@gmx.net> <4A99C617.6060106@nopersonal.info> Message-ID: <4A9A0106.1010908@gmx.net> lists at nopersonal.info wrote: > > Okay, wait--but what about what Dan said re NULL values not being added > to averages, making them useful statistically? In that case wouldn't you > want NULL to stay NULL? IOW, in his case the query would would only > retrieve values WHERE foo != NULL? But then the manual says that the > arithmetic comparison operators won't work with NULL, so that can't be > right... Dan mentioned a case where having NULL is of good use, because in his example it makes a difference if the person responding to a survey doesn't answer the question or answers it with 0. If there is no answer you cannot treat it the same way as 0. It is an example that I didn't think about. What I was talking about was in regards to variables in PHP being NULL. The "retrieve values WHERE foo != NULL" is SQL. That is a different language. > Hang on, let me think a minute... Okay, so then I guess you'd just > assign a value of 0 or '' to anything that was NULL, and then have PHP > only calculate numbers where $foo >= 1? But if that's the case, then why > use NULL in the first place? That can't be right, so I must still be > missing some important point. Just because I couldn't come up with a case for using NULL (and I tried to find one) doesn't mean there is one. Dan is right and his example is spot on. My explanation wasn't wrong, but incomplete. > One last try: Maybe the query would be along the lines of SELECT * WHERE > foo NOT IN NULL, that way there wouldn't be any need to deal with it > because since it was never retrieved in the first place...? I fired up my rusty PHP IDE and tried a few things. Turns out that SQL is way more picky about what NULL is, whereas PHP considers NULL often as 0 or an ampty string. For example, when you have this in PHP you will see "they are the same" as output. In SQL when your run SELECT * FROM Table WHERE Field = NULL and then SELECT * FROM Table WHERE Field = '' you may very well end up with two different results. I think it has to do with the fact that PHP doesn't take it too serious with the type of variable. For example gives you this output: 12threefour PHP just makes the integer into a string and sticks both together. In other languages this throws an error, because the variables are not of the same type. That said, for SQL searching for something that is NULL isn't the same as searching for something that is 0. PHP allows for the more picky way in comparison by using three equal signs. That means that won't output anything. Only if you set $a to NULL as well you will see text as output. It took me a while and a few tries to remember how PHP treats NULL. It basically is the same as not assigning any value or unsetting a variable or array (which seems to be a quick way to figure out if an array is empty). For example outputs 23. So, what I propose you keep in mind is that PHP knows about NULL, but treats it as if it is 0 for numerical variables or as an empty string. In SQL it is not the case. If PHP's behaviour is right or wrong can be hotly debated. I like that it doesn't take it too serious with the variable type, but just to assume that some undefined variable is out of a sudden 0 is quite bold. But that's the way it is and when one knows about it one can deal with it. > Sorry for making you witness my somewhat scattershot thinking process, > but even the smallest sequences of programming logic can still be a big > challenge for me. See, I hate programming and programming hates me. I do like programming in PHP, because PHP isn't so anal about stuff like this as Java or C. That makes me think less. The problem is that you might end up with really bad results. For example when no submission is an error condition, but submitting an empty string or 0 is fine. In that case having NULL be the same as zero is not what you want. So while for most cases PHP's assumptions work out fine I wouldn't count on PHP being always right. >> Sure, one could say that NULL is the same as 0 or "", but that is a >> purely arbitrary interpretation, although maybe a convenient one. > > Got it. See above, it is very convenient, because sqrt(NULL) gives 0 and not an error. >> I hope I explained it in an understandable way. > > You did an awesome job of explaining. Thanks again for taking the time > to help. You are welcome, just keep in mind that PHP and SQL aren't the same, even when we often mush them together in code. David From ajai at bitblit.net Sun Aug 30 00:46:18 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sun, 30 Aug 2009 00:46:18 -0400 (EDT) Subject: [nycphp-talk] Working with designers In-Reply-To: <4A957808.6030704@nopersonal.info> Message-ID: On Wed, 26 Aug 2009, lists at nopersonal.info wrote: > I suppose that's partly because designers' creativity is by nature > visually oriented, whereas programming requires more of a... I'm not > sure what to call it... maybe creativity of logic? It requires mental visualization of abstract concepts and models, i.e. exactly the opposite of a visually-oriented process. > It's too bad that there's often so much misunderstanding and friction > between the two--it's sort of like beauty of form vs. beauty of > function. IMO, the best applications embody both by being so elegantly > designed (both visually & functionally) that they are nearly > invisible--i.e. they allow the end user to perform tasks without having > to spend a bunch of time trying to figure out how things work. Remember "Hackers & Painters"? More similar than different... -- Aj. From ajai at bitblit.net Sun Aug 30 00:59:29 2009 From: ajai at bitblit.net (Ajai Khattri) Date: Sun, 30 Aug 2009 00:59:29 -0400 (EDT) Subject: [nycphp-talk] Working with designers In-Reply-To: Message-ID: On Thu, 27 Aug 2009, tedd wrote: > I know what you mean. For me, clients basically fall into two groups: > a) Those who tell me what they want; b) And those who tell me how to > do what they want. I work well with (a), but have problems with (b). Should there also be (c) people who dont really know what they want ? > Many think, as I've been told "It's easy -- my > son learned HTML in high school" Probably why a lot of people dont take programming seriously as a profession... > while they are totally clueless. The > most problematic students/clients are the ones who have some > experience with HTML and think that's all there is. As I like to say "They dont know how much they dont know" :-) > Furthermore, the number of actual web developers out there who do > know how to program in all the web languages (i.e., namely html, css, > javascript, php, mysql, et al) to create a truly functional web site, > are very few. I find that hard to believe. Web developers *should* know all of those as a *minimum*. > And lastly, none of this is static. I spend time every day learning > something new -- the web is constantly changing and keeping up with > it is a daily challenge. I was quoted a long time ago as saying: > > "I've learned something new every day of my life -- and I'm getting > damned tried of it." That's true of anyone involved in technology (well, at least those of us that manage our skill set and careers). -- Aj. From oorza2k5 at gmail.com Sun Aug 30 01:10:28 2009 From: oorza2k5 at gmail.com (Eddie Drapkin) Date: Sun, 30 Aug 2009 01:10:28 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <00a801ca28f7$1b1f26e0$515d74a0$@com> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> <016601ca2819$9d14cd00$d73e6700$@com> <4A983ABB.6010503@devonianfarm.com> <00a801ca28f7$1b1f26e0$515d74a0$@com> Message-ID: <68de37340908292210s163f3ebem59babbbbe60cf1a2@mail.gmail.com> On Sat, Aug 29, 2009 at 6:21 PM, Hans Zaunere wrote: > Yeah something like this could be handy, certainly. ?I typically push/adapt > an object into the template which is property overloaded. ?Then something > like: > > FirstName?> > > Outputs correctly escaped (or processed in any other way depending on what > the overload wants to do) content. ?Quite handy and has proved effective. > > It does seem that it'd be handy to have some type of "stdout" processing > hook that can be overridden, while providing a shorthand for working in > templates. > I played around with a class for a while that was something like this: abstract class AbstractViewDataBucket { /* * This will be called for manually set private members. */ public function __get($var) { return htmlspecialchars($this->$var); } /* * This is here because manually overridden variables * that aren't already set are set publicly, although * __set() is called when they're defined. This allows us * to make classes with no pre-defined members. */ public function __set($var, $val) { $this->$var = htmlspecialchars($val); } } And all my classes that held data for templates worked "magically." So, something like: $foo = new RandomViewDataThatExtendsTheAformentionedClass(); $foo->bar = 'baz'; $foo->hi = 'hello'; ... (in another file): bar; ?> hi; ?> ... This sort of crap would work as expected. Similarly (and sort of derailing), before I switched to prepared statements and actually manually escaped database strings (thank god that period of my life is over), I had used another class that worked similarily, only calling mysqli_real_escape_string() instead of htmlspecialchars(). I'm a huge fan of small, single-use classes, so this schema worked well for me. It also allows overriding if necessary, like one class that needed to verify that data was UTF8, while other classes didn't care so much. Another idea with the overriding of "stdout" processing, you could abuse output buffering and the callback support that comes with it, although a major initial hurdle would be deciding what to escape. Any solution I can think ofresults in spending more time supporting the output handling than would be saved by using them. Doesn't mean it's impossible, of course ;) And on another note, historically speaking, things that offer a sense of security that are built into PHP (magic quotes and safe mode, anyone?) aren't very useful and are often seen as a false sense of security. Having something like (and I'm 99% sure References: <1251578829.5291@coral.he.net> <4A99D1C6.8020606@nopersonal.info> <20090830031616.GA10697@panix.com> Message-ID: <4A9A0BC2.4080504@nopersonal.info> Hi Dan, Daniel Convissor wrote: > Your big mistake was delimiting the identifiers when creating the table. > > "Identifiers" are table names, field names, index names, etc. The > "delimiter" for these is "`" in MySQL. When you use the delimiter around > the identifiers, the database allows you to create nearly any name you > can possibly think of, including "reserved words." Reserved words are, > well words that the system has reserved for its own internal use, so > should not be utilized by users. As you've now discovered, delimiting > identifiers when creating tables is the genesis of a world of pain. This is really important stuff and I don't remember it being covered in any of my "beginner" books. Grrr. > If you tried to create a table with a name called "desc" in it without > delimiting it, MySQL would have complained to you up front, saving you > the agony. The thing is, I have no idea how I managed to delimit the identifiers. I created my everything using phpMyAdmin--could that have been the culprit? The reason I ask is because I just tried it again and MySQL didn't complain. Since you said it should be complaining, I decided to attempt the same using a trial version of Navicat that I downloaded a few days ago. Sure enough, MySQL threw a syntax error right away. WTF? If you tell me that I should be talking to MySQL from the command line I'm going to jump out the window forthwith. ;) >> Or like the time (very recently) when I was converting timestamps to >> calculate the number of days between two given dates. I used the >> number_format() function... > > Uh, just making sure... Did you convert the timestamps via > number_format() then do the math? Ouch. This is the kind of stuff the > date functions, like date_diff(), etc, in MySQL and PHP are for. > Faster, more accurate, easier. Then format the result. Actually, my description wasn't very accurate. I guess I sort of did it in the middle--after the math to calculate the number of days between "today" and the expiration date, but before telling PHP to check for a specific number days See below). Where you now see round() is where I was previously using number_format(): $todays_date = date("Y-m-d"); $today = strtotime($todays_date); $exp_date = strtotime($exp_date); $diff = ($exp_date - $today); $num_days = ($diff / 86400); $num_days = round($num_days, 0); $exp_date = date('m-d-y', $exp_date); if ($num_days <= 60 && $num_days >= 46) { $exp_date = ''.$exp_date.' } //...and so on In MySQL the exp_date field data type is DATE. I strongly suspect that I'm handling my dates in the most verbose & confusing way possible, and I know for a fact that I didn't properly normalize my tables. IOW, I managed to make things work, but it's a big mess. I'm currently trying to redo everything, but with limited success as trying to grope my way through the fog of my inexperience results in frequent rounds of tripping & falling face-first into the mud. I eventually figure stuff out and inch my way up a little, but it's a slow, painful climb. Sometimes I sort of feel like Sisyphus. *sigh* I'm going to go check out the date_diff() function... Bev From ka at kacomputerconsulting.com Sun Aug 30 09:20:05 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Sun, 30 Aug 2009 06:20:05 -0700 Subject: [nycphp-talk] naming identifiers Message-ID: <1251638405.9317@coral.he.net> Bev, phpMyAdmin often puts those funny sideways leaning apostrophes/quotes -- ` -- around table names and field names when it writes its queries. You want to remove those before you create or change any table or field names, I think is what he means in practical terms. That way you will get errors on reserved words. Also you can try to avoid your own confusion by giving longer, more detailed names to fields. Some people hate this idea but to me a little extra typing is worth the clarity. Kristina > Hi Dan, > > Daniel Convissor wrote: > > Your big mistake was delimiting the identifiers when creating the table. > > > > "Identifiers" are table names, field names, index names, etc. The > > "delimiter" for these is "`" in MySQL. When you use the delimiter around > > the identifiers, the database allows you to create nearly any name you > > can possibly think of, including "reserved words." Reserved words are, > > well words that the system has reserved for its own internal use, so > > should not be utilized by users. As you've now discovered, delimiting > > identifiers when creating tables is the genesis of a world of pain. > > This is really important stuff and I don't remember it being covered in > any of my "beginner" books. Grrr. > > > If you tried to create a table with a name called "desc" in it without > > delimiting it, MySQL would have complained to you up front, saving you > > the agony. > > The thing is, I have no idea how I managed to delimit the identifiers. I > created my everything using phpMyAdmin--could that have been the > culprit? The reason I ask is because I just tried it again and MySQL > didn't complain. Since you said it should be complaining, I decided to > attempt the same using a trial version of Navicat that I downloaded a > few days ago. Sure enough, MySQL threw a syntax error right away. WTF? > > If you tell me that I should be talking to MySQL from the command line > I'm going to jump out the window forthwith. ;) > > >> Or like the time (very recently) when I was converting timestamps to > >> calculate the number of days between two given dates. I used the > >> number_format() function... > > > > Uh, just making sure... Did you convert the timestamps via > > number_format() then do the math? Ouch. This is the kind of stuff the > > date functions, like date_diff(), etc, in MySQL and PHP are for. > > Faster, more accurate, easier. Then format the result. > > Actually, my description wasn't very accurate. I guess I sort of did it > in the middle--after the math to calculate the number of days between > "today" and the expiration date, but before telling PHP to check for a > specific number days See below). Where you now see round() is where I > was previously using number_format(): > > $todays_date = date("Y-m-d"); > $today = strtotime($todays_date); > $exp_date = strtotime($exp_date); > $diff = ($exp_date - $today); > $num_days = ($diff / 86400); > $num_days = round($num_days, 0); > $exp_date = date('m-d-y', $exp_date); > if ($num_days <= 60 && $num_days >= 46) { > $exp_date = ''.$exp_date.' > } //...and so on > > In MySQL the exp_date field data type is DATE. I strongly suspect that > I'm handling my dates in the most verbose & confusing way possible, and > I know for a fact that I didn't properly normalize my tables. IOW, I > managed to make things work, but it's a big mess. > > I'm currently trying to redo everything, but with limited success as > trying to grope my way through the fog of my inexperience results in > frequent rounds of tripping & falling face-first into the mud. I > eventually figure stuff out and inch my way up a little, but it's a > slow, painful climb. > > Sometimes I sort of feel like Sisyphus. *sigh* > > I'm going to go check out the date_diff() function... > > Bev > > _______________________________________________ > 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 Sun Aug 30 09:39:53 2009 From: ramons at gmx.net (David Krings) Date: Sun, 30 Aug 2009 09:39:53 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <1251638405.9317@coral.he.net> References: <1251638405.9317@coral.he.net> Message-ID: <4A9A8129.5030303@gmx.net> Kristina D. H. Anderson wrote: > Also you can try to avoid your own confusion by giving longer, more > detailed names to fields. Some people hate this idea but to me a > little extra typing is worth the clarity. Not only for yourself, but everyone else dealing with your database and code. Also, I recommend naming fields with the same content by the same name across the database. So rather than calling a field "RecordID" call it "FooRecordID" even when that is obvious when that field is in table Foo. It doesn't get that obvious anymore when you use that record ID in the table Bar. Calling it just there "FooRecordID" may be OK, but I come across way too many tables where such a field is called "GizmoID" because table Foo stores the records for gizmos, but it isn't called "Gizmo". That really rapidly inhales. And in any case create and maintain a data dictionary so that one doesn't have to sift through all the field descriptions in the table views. David From lists at nopersonal.info Sun Aug 30 09:48:14 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 09:48:14 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <1251638405.9317@coral.he.net> References: <1251638405.9317@coral.he.net> Message-ID: <4A9A831E.4040306@nopersonal.info> Good Morning Kristina, Kristina D. H. Anderson wrote: > phpMyAdmin often puts those funny sideways leaning apostrophes/quotes -- > ` -- around table names and field names when it writes its queries. > You want to remove those before you create or change any table or field > names, I think is what he means in practical terms. That way you will > get errors on reserved words. I've seen those odd little quotes on the few occasions that I've used phpMySQL to create queries, but the thing is I didn't use that when I created the tables--I just used the little text field on the main db page to give it a name, then entered how many fields I wanted and clicked "Go". So it must have inserted them behind the scenes. > Also you can try to avoid your own confusion by giving longer, more > detailed names to fields. Some people hate this idea but to me a > little extra typing is worth the clarity. Amen to that! That's exactly what I'm doing these days. If a field name doesn't warrant an underscore, then I have to be 100% sure that it's not a reserved word--if I'm not sure, then I check. There is no way I want to repeat that suffering again. Bev From tedd at sperling.com Sun Aug 30 09:58:48 2009 From: tedd at sperling.com (tedd) Date: Sun, 30 Aug 2009 09:58:48 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <4A9A0BC2.4080504@nopersonal.info> References: <1251578829.5291@coral.he.net> <4A99D1C6.8020606@nopersonal.info> <20090830031616.GA10697@panix.com> <4A9A0BC2.4080504@nopersonal.info> Message-ID: At 1:18 AM -0400 8/30/09, lists at nopersonal.info wrote: >-snip- > >In MySQL the exp_date field data type is DATE. I strongly suspect that >I'm handling my dates in the most verbose & confusing way possible, True, you're not handling the date thing correctly, but you're close. You need to understand how the date was entered into the database. Check out: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date and review the DATE and NOW functions. Once you find out the format of how the date was recorded, then you can figure out how to extract and use the date for calculating your expiration date. As for verbosity, I'm all for it if it's in the name of clarity. You don't need to be cryptic for your code to work. Just the opposite, take whatever steps you think you need to detail what you are doing. I often start with a simple statement telling what I expect the following code to do, such as: // This extracts the full name of the tutor from the database and then I write code to do that. Each step is clearly laid out with documentation. If I have to use extra variables to understand what's going on, that's not a big deal in my book, but clarity is. Take your time, think things out, and organize your code into small solution for small problems. Understand each step. Eventually, the bigger problems will reduce into small problems and you'll find you've finished. And you've finished you will understand what it does. ------- >I know for a fact that I didn't properly normalize my tables. IOW, I >managed to make things work, but it's a big mess. Normalizing tables is not intuitive, or at least it was not for me. The simple rule is to not duplicate data in your database. For example, if you have a Customer table that holds the name and address of someone and a Purchase table shows what the person purchased, then you do not have to repeat the name and address field in the Purchase table. Instead, you use the index of the person from the Customer table to identify them, such as: Customer table id first_name last_name address 345 Bev Woohoo 123 Tulip Item table id item_name cost 1576 Hair Setter 39.95 Purchase table id customer_id item_purchased 2003 345 1576 If you will review the above tables, you will see that by looking at the Purchase table, you can deduce the customer 345 (you), purchased item 1576 (Hair Setter) for $38.95. Neat huh? Of course, you can add things like inventory to the Item table and date of purchase to the Purchase table, and zip code to the Customer table, but this example was simply to show you how these three tables can be used to provide the data you want without repeating the data anywhere. Everything is done via indexes. --- >I'm currently trying to redo everything, but with limited success as >trying to grope my way through the fog of my inexperience results in >frequent rounds of tripping & falling face-first into the mud. I >eventually figure stuff out and inch my way up a little, but it's a >slow, painful climb. If you know some other way, please let me know because that's the way I learn. ----- >Sometimes I sort of feel like Sisyphus. *sigh* Try Penicillin -- I hear that works. :-) Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ka at kacomputerconsulting.com Sun Aug 30 10:05:44 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Sun, 30 Aug 2009 07:05:44 -0700 Subject: [nycphp-talk] naming identifiers Message-ID: <1251641144.26521@coral.he.net> Bev, Good morning to you as well! I'd imagine that yes, the table-creation widget inside phpMyAdmin probably does execute the queries that way, as that seems to be its default mode. I'm not sure if you can change settings to remove that behavior... There are a lot of reasons to like phpMyAdmin (well, a few reasons at least) but also a lot of reasons to hate it. For instance, once the database reaches a certain size, you won't be able to back it up using phpMyAdmin, but will have to use the command line. That's sort of lame. At the bare minimum, if you're going to use phpMyAdmin to create tables, do it in raw SQL instead of using the widget. PS I'm wondering what my mother would say if she knew I spent basically my entire weekend talking about databases..."that's no way to find a husband, Kristina" is what she'd probably say...and she's probably right. Lucky thing I'm not looking for one....! :) Kristina > Good Morning Kristina, > > Kristina D. H. Anderson wrote: > > phpMyAdmin often puts those funny sideways leaning apostrophes/quotes -- > > ` -- around table names and field names when it writes its queries. > > You want to remove those before you create or change any table or field > > names, I think is what he means in practical terms. That way you will > > get errors on reserved words. > > I've seen those odd little quotes on the few occasions that I've used > phpMySQL to create queries, but the thing is I didn't use that when I > created the tables--I just used the little text field on the main db > page to give it a name, then entered how many fields I wanted and > clicked "Go". So it must have inserted them behind the scenes. > > > Also you can try to avoid your own confusion by giving longer, more > > detailed names to fields. Some people hate this idea but to me a > > little extra typing is worth the clarity. > > Amen to that! That's exactly what I'm doing these days. If a field name > doesn't warrant an underscore, then I have to be 100% sure that it's not > a reserved word--if I'm not sure, then I check. There is no way I want > to repeat that suffering again. > > Bev > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From tedd at sperling.com Sun Aug 30 10:06:58 2009 From: tedd at sperling.com (tedd) Date: Sun, 30 Aug 2009 10:06:58 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A99ED57.3060309@nopersonal.info> References: <1251598145.24962@coral.he.net> <4A99ED57.3060309@nopersonal.info> Message-ID: At 11:09 PM -0400 8/29/09, lists at nopersonal.info wrote: >*wonders if this programming stuff is ever going to get easier* Not any easier, but more enjoyable. Once you figure out how to hold a hammer, you can beat the crap out of a lot of stuff while learning what a screwdriver is used for. Then with hammer and screw driver in hand, you can do some serious damage while learning what other tools do. Eventually you can get to building your first bird house, then shed, and then home. Like everything else, it takes time. Enjoy the trip. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From lists at nopersonal.info Sun Aug 30 10:12:05 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 10:12:05 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <017b01ca2926$b203ccd0$160b6670$@com> References: <4A99895A.7030702@nopersonal.info> <017b01ca2926$b203ccd0$160b6670$@com> Message-ID: <4A9A88B5.4010303@nopersonal.info> Hans Zaunere wrote: > NULL is just a type - a type that can only ever be one thing - NULL I think I get that part now: The moment it has a known value, even if that value is '' or zero, then it's no longer NULL (at least in the world according to MySQL). > NULL comes from pointers, largely where there can be null references > or pointers. It's an address that doesn't point anywhere, but is > some way pointed to and acknowledged, thus it's not purely > non-existent (yes, we could argue for years on the subtle meanings of > NULL, void, undefined, etc. :) Hans, you're going to make my head explode. LOL > As always, there's only one real resource these days: > > http://en.wikipedia.org/wiki/Null Oddly, while I go to Wikipedia probably a dozen times a day for answers, it never occurred to me to look up NULL there. Go figure. > To me, pragmatically, NULL really only comes down to one thing - it's > a special type that always has a single value. Different languages > and environments then utilize this type differently, and add their > own meanings. Thus you need to read the different environment's docs > to learn how NULL is treated specifically in that environment, and > how it affects getting things down in that environment. There is no > "global" real meaning of NULL - it's language specific. Noted. > Other than that NULL is meaningless - it's NULL :) Bev :) From lists at enobrev.com Sun Aug 30 10:11:45 2009 From: lists at enobrev.com (Mark Armendariz) Date: Sun, 30 Aug 2009 10:11:45 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <4A9A831E.4040306@nopersonal.info> References: <1251638405.9317@coral.he.net> <4A9A831E.4040306@nopersonal.info> Message-ID: <4A9A88A1.9070102@enobrev.com> lists at nopersonal.info wrote: > I've seen those odd little quotes on the few occasions that I've used > phpMySQL to create queries They're called backticks. http://dev.mysql.com/doc/refman/5.0/en/identifiers.html Happy weekend. Mark From lists at nopersonal.info Sun Aug 30 10:13:30 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 10:13:30 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <20090830040543.GB2118@panix.com> References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> Message-ID: <4A9A890A.9000403@nopersonal.info> Daniel Convissor wrote: > Server side validation/escaping/prepared statements is > required for security reasons. Dan, you're referring to the filter output part of the "validate input, filter output" mantra I've memorized, right? Just checking... Bev From lists at nopersonal.info Sun Aug 30 10:15:36 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 10:15:36 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: Message-ID: <4A9A8988.7040705@nopersonal.info> Ajai Khattri wrote: >> I suppose that's partly because designers' creativity is by nature >> visually oriented, whereas programming requires more of a... I'm not >> sure what to call it... maybe creativity of logic? > > It requires mental visualization of abstract concepts and models, i.e. > exactly the opposite of a visually-oriented process. Excellent and very accurate description. That one's going in my notes. >> It's too bad that there's often so much misunderstanding and friction >> between the two--it's sort of like beauty of form vs. beauty of >> function. IMO, the best applications embody both by being so elegantly >> designed (both visually & functionally) that they are nearly >> invisible--i.e. they allow the end user to perform tasks without having >> to spend a bunch of time trying to figure out how things work. > > Remember "Hackers & Painters"? More similar than different... Actually, I'd never heard of it till you mentioned it, so I looked it up--sounds interesting. Bev From tedd at sperling.com Sun Aug 30 10:22:11 2009 From: tedd at sperling.com (tedd) Date: Sun, 30 Aug 2009 10:22:11 -0400 Subject: [nycphp-talk] Working with designers In-Reply-To: References: Message-ID: At 12:59 AM -0400 8/30/09, Ajai Khattri wrote: >On Thu, 27 Aug 2009, tedd wrote: > > > Furthermore, the number of actual web developers out there who do >> know how to program in all the web languages (i.e., namely html, css, >> javascript, php, mysql, et al) to create a truly functional web site, >> are very few. > >I find that hard to believe. Web developers *should* know all of those as >a *minimum*. Should yes, but many don't. Many wing it knowing just enough to get by and be dangerous. I review code almost everyday where someone though they were doing it right, but their product was not up to standards. For example, try validating web sites -- you'll see that the majority fail having html errors -- and html is easy to fix! Also look at the amount of embedded css you find in html and php stuff -- some done by very good php programmers who simply don't know any better. Also, look at javascript routines and see the amount of unobtrusive code as compared to the embedded stuff. Again, good javascript programmers who don't know how to program unobtrusively. Now, combine all of that into being truly multilingual and you'll find very few who actually master it. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From lists at nopersonal.info Sun Aug 30 10:22:26 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 10:22:26 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <4A9A88A1.9070102@enobrev.com> References: <1251638405.9317@coral.he.net> <4A9A831E.4040306@nopersonal.info> <4A9A88A1.9070102@enobrev.com> Message-ID: <4A9A8B22.4060307@nopersonal.info> Mark Armendariz wrote: > lists at nopersonal.info wrote: >> I've seen those odd little quotes on the few occasions that I've used >> phpMySQL to create queries > They're called backticks. > > http://dev.mysql.com/doc/refman/5.0/en/identifiers.html Thanks, Mark > Happy weekend. You too. Bev From dirn at dirnonline.com Sun Aug 30 10:37:33 2009 From: dirn at dirnonline.com (Andy Dirnberger) Date: Sun, 30 Aug 2009 10:37:33 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <1251641144.26521@coral.he.net> References: <1251641144.26521@coral.he.net> Message-ID: > For instance, once the > database reaches a certain size, you won't be able to back it up using > phpMyAdmin, but will have to use the command line. ?That's sort of lame. > > At the bare minimum, if you're going to use phpMyAdmin to create > tables, do it in raw SQL instead of using the widget. I have to disagree with both of these statements. I don't know of any size that phpMyAdmin can't handle. Most web servers aren't configured to handle the amount of memory needed to export extra large databases. It's Apache (nginx, IIS, lighttpd, et al) that can't handle the size. And I use phpMyAdmin to create my tables all the time. If you are afraid that you might use a reserved keyword for a field name, use the ` delimiters around the name of the field in your queries. I know that I've used desc as a field name before (yes, I could be less lazy and just type out description). I just make sure to escape it with `. Most frameworks will automatically do this for you (for all field names, not just reserved words). If you aren't using a framework, there is no reason you can't do it yourself. SELECT * FROM `table` WHERE `field` = 'value' It may take a little getting used to, but it's a good habit to get into. From dirn at dirnonline.com Sun Aug 30 10:43:25 2009 From: dirn at dirnonline.com (Andy Dirnberger) Date: Sun, 30 Aug 2009 10:43:25 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9A890A.9000403@nopersonal.info> References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> Message-ID: > Dan, you're referring to the filter output part of the "validate input, > filter output" mantra I've memorized, right? Just checking... > I believe he's referring to server-side validation ("validate input"). Earlier Kristina said "you'll want to use a combination of client-side (form) validation and good database design." While client-side validation is nice for the user (they don't have to wait for the page to reload), using client-side validation doesn't replace the need to validation the data once it gets back to the server. From danielc at analysisandsolutions.com Sun Aug 30 10:51:19 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 30 Aug 2009 10:51:19 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> Message-ID: <20090830145119.GA29654@panix.com> Hi: On Sun, Aug 30, 2009 at 10:43:25AM -0400, Andy Dirnberger wrote: > > Dan, you're referring to the filter output part of the "validate input, > > filter output" mantra I've memorized, right? Just checking... > > > > I believe he's referring to server-side validation ("validate input"). Exactly. Though Bev, you do have a good point, one needs to escape (filter) output as well. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From lists at nopersonal.info Sun Aug 30 10:54:45 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 10:54:45 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> Message-ID: <4A9A92B5.1030907@nopersonal.info> Andy Dirnberger wrote: >> Dan, you're referring to the filter output part of the "validate input, >> filter output" mantra I've memorized, right? Just checking... >> > > I believe he's referring to server-side validation ("validate input"). > Earlier Kristina said "you'll want to use a combination of > client-side (form) validation and good database design." While > client-side validation is nice for the user (they don't have to wait > for the page to reload), using client-side validation doesn't replace > the need to validation the data once it gets back to the server. Hi Andy, I hate javascript so I never validate anything client side, but thanks for clarifying. Bev From lists at nopersonal.info Sun Aug 30 11:02:24 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 11:02:24 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9A92B5.1030907@nopersonal.info> References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> <4A9A92B5.1030907@nopersonal.info> Message-ID: <4A9A9480.1020002@nopersonal.info> lists at nopersonal.info wrote: > I hate javascript so I never validate anything client side, but thanks > for clarifying. Just to clarify, what I meant was that I always validate server side with PHP, never client side. I don't want to get hollered at for not validating. ;) Bev From tedd at sperling.com Sun Aug 30 11:10:12 2009 From: tedd at sperling.com (tedd) Date: Sun, 30 Aug 2009 11:10:12 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9A92B5.1030907@nopersonal.info> References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> <4A9A92B5.1030907@nopersonal.info> Message-ID: At 10:54 AM -0400 8/30/09, lists at nopersonal.info wrote: >Andy Dirnberger wrote: >>> Dan, you're referring to the filter output part of the "validate input, >>> filter output" mantra I've memorized, right? Just checking... >>> >> >> I believe he's referring to server-side validation ("validate input"). >> Earlier Kristina said "you'll want to use a combination of >> client-side (form) validation and good database design." While >> client-side validation is nice for the user (they don't have to wait >> for the page to reload), using client-side validation doesn't replace >> the need to validation the data once it gets back to the server. > >Hi Andy, > >I hate javascript so I never validate anything client side, but thanks >for clarifying. > >Bev Bev: Javascript is just another language AND a way to interact with the user that php can't. It's just another tool to learn and use. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From lists at nopersonal.info Sun Aug 30 11:12:30 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 11:12:30 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9A0106.1010908@gmx.net> References: <4A99895A.7030702@nopersonal.info> <4A9992A6.2020501@gmx.net> <4A99C617.6060106@nopersonal.info> <4A9A0106.1010908@gmx.net> Message-ID: <4A9A96DE.6010306@nopersonal.info> David Krings wrote: > Dan mentioned a case where having NULL is of good use, because in his > example it makes a difference if the person responding to a survey > doesn't answer the question or answers it with 0. If there is no answer > you cannot treat it the same way as 0. It is an example that I didn't > think about. > What I was talking about was in regards to variables in PHP being NULL. > The "retrieve values WHERE foo != NULL" is SQL. That is a different > language. I need to be pay more attention to the differences between the way PHP & MySQL handle things. Becuase they always seem to go hand in hand, it's easy for me to forget that they're two separate languages. > Just because I couldn't come up with a case for using NULL (and I tried > to find one) doesn't mean there is one. Dan is right and his example is > spot on. My explanation wasn't wrong, but incomplete. Understood. > I fired up my rusty PHP IDE and tried a few things. Turns out that SQL > is way more picky about what NULL is, whereas PHP considers NULL often > as 0 or an ampty string. For example... Wow, thanks for taking the time to do that. At some point between now & next weekend I'm going to gather everyone's examples and play around with them so I can see what happens for myself. > So, what I propose you keep in mind is that PHP knows about NULL, but > treats it as if it is 0 for numerical variables or as an empty string. > In SQL it is not the case. If PHP's behaviour is right or wrong can be > hotly debated. I like that it doesn't take it too serious with the > variable type, but just to assume that some undefined variable is out of > a sudden 0 is quite bold. But that's the way it is and when one knows > about it one can deal with it. I'll keep that in mind. > See, I hate programming and programming hates me. I do like programming > in PHP, because PHP isn't so anal about stuff like this as Java or C. > That makes me think less. The problem is that you might end up with > really bad results. For example when no submission is an error > condition, but submitting an empty string or 0 is fine. In that case > having NULL be the same as zero is not what you want. So while for most > cases PHP's assumptions work out fine I wouldn't count on PHP being > always right. That's an important point, knowing that PHP can sometimes be a little too forgiving. > You are welcome, just keep in mind that PHP and SQL aren't the same, > even when we often mush them together in code. I have a feeling you guys aren't going to let em forget it. ;) Bev From webmaster at vbplusme.com Sun Aug 30 11:12:39 2009 From: webmaster at vbplusme.com (webmaster at vbplusme.com) Date: Sun, 30 Aug 2009 23:12:39 +0800 Subject: [nycphp-talk] naming identifiers In-Reply-To: <1251641144.26521@coral.he.net> References: <1251641144.26521@coral.he.net> Message-ID: <579377525.20090830231239@vbplusme.com> Hello Kristina, Sunday, August 30, 2009, 10:05:44 PM, you wrote: > Bev, > Good morning to you as well! I'd imagine that yes, the table-creation > widget inside phpMyAdmin probably does execute the queries that way, as > that seems to be its default mode. I'm not sure if you can change > settings to remove that behavior... > There are a lot of reasons to like phpMyAdmin (well, a few reasons at > least) but also a lot of reasons to hate it. For instance, once the > database reaches a certain size, you won't be able to back it up using > phpMyAdmin, but will have to use the command line. That's sort of lame. > At the bare minimum, if you're going to use phpMyAdmin to create > tables, do it in raw SQL instead of using the widget. > PS I'm wondering what my mother would say if she knew I spent basically > my entire weekend talking about databases..."that's no way to find a > husband, Kristina" is what she'd probably say...and she's probably > right. Lucky thing I'm not looking for one....! > :) Kristina >> Good Morning Kristina, >> >> Kristina D. H. Anderson wrote: >> > phpMyAdmin often puts those funny sideways leaning > apostrophes/quotes -- >> > ` -- around table names and field names when it writes its > queries. >> > You want to remove those before you create or change any table or > field >> > names, I think is what he means in practical terms. That way you > will >> > get errors on reserved words. >> >> I've seen those odd little quotes on the few occasions that I've used >> phpMySQL to create queries, but the thing is I didn't use that when I >> created the tables--I just used the little text field on the main db >> page to give it a name, then entered how many fields I wanted and >> clicked "Go". So it must have inserted them behind the scenes. >> >> > Also you can try to avoid your own confusion by giving longer, more >> > detailed names to fields. Some people hate this idea but to me a >> > little extra typing is worth the clarity. >> >> Amen to that! That's exactly what I'm doing these days. If a field > name >> doesn't warrant an underscore, then I have to be 100% sure that it's > not >> a reserved word--if I'm not sure, then I check. There is no way I want >> to repeat that suffering again. >> >> Bev >> >> >> _______________________________________________ >> 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 > __________ Information from ESET NOD32 Antivirus, version of virus > signature database 4381 (20090830) __________ > The message was checked by ESET NOD32 Antivirus. > http://www.eset.com I use backticks all time to avoid ambiguity in Database and Table names. I have never had any problem with them but I HAVE had problems with not using them in the past where the mysql on the server that I was using didn't like queries that didn't have them, go figure? -- Best regards, webmaster mailto:webmaster at vbplusme.com From tedd at sperling.com Sun Aug 30 11:13:51 2009 From: tedd at sperling.com (tedd) Date: Sun, 30 Aug 2009 11:13:51 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9A9480.1020002@nopersonal.info> References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> <4A9A92B5.1030907@nopersonal.info> <4A9A9480.1020002@nopersonal.info> Message-ID: At 11:02 AM -0400 8/30/09, lists at nopersonal.info wrote: >lists at nopersonal.info wrote: >> I hate javascript so I never validate anything client side, but thanks >> for clarifying. > >Just to clarify, what I meant was that I always validate server side >with PHP, never client side. I don't want to get hollered at for not >validating. ;) > >Bev Bev: While you don't validate client-side, you certainly can confirm and therein lies it's usefulness. Take this for example: http://webbytedd.com/c/form-calc/ That would be a nightmare to handle just with php. Every tool has it's job. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From ramons at gmx.net Sun Aug 30 11:19:15 2009 From: ramons at gmx.net (David Krings) Date: Sun, 30 Aug 2009 11:19:15 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: References: <1251641144.26521@coral.he.net> Message-ID: <4A9A9873.5040603@gmx.net> Andy Dirnberger wrote: > And I use phpMyAdmin to create my tables all the time. If you are I use the XAMPP from Apachefriends and the first thing I ditch is phpMyAdmin. I probably should give it a shot again, but it used to be very limited and buggy. I find the MySQL GUI tools do a good job. They lack a bit of quality as well (although that depends on the build a lot), but they got all you need and are darn easy to use. A really nice MySQL frontend for Windoze is Luckasoft's client (see http://www.enginsite.com/MySQL-client-manager-and-GUI-for-MySQL.htm). The only problem I have with that one is that it costs 30$. I was lucky and at some point got a free license. Luckasoft also makes an IDE for PHP, which is really not bad. I just hope Sergey Lucka found some time to reimplement the debugger correctly so that it doesn't stop at the beginning of each script file. That is really annoying and made this otherwise fine and inexpensive IDE not very useful for the hobby development that I do. Sorry, I'm digressing.... David From lists at nopersonal.info Sun Aug 30 11:42:39 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 11:42:39 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9A9A4D.9040104@nopersonal.info> References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> <4A9A92B5.1030907@nopersonal.info> <4A9A9A4D.9040104@nopersonal.info> Message-ID: <4A9A9DEF.6090209@nopersonal.info> lists at nopersonal.info wrote: > tedd wrote: >> Javascript is just another language AND a way to interact with the user >> that php can't. It's just another tool to learn and use. Yeah, I know, and I do use it when I feel it's the best option (or sometimes the only option), but I just intensely dislike it. I know this is going to sound irrational, but I hate the way it looks. It's fugly. I guess I also resent it for the way people have abused it. I loathe having control of my browser taken away from me, y'know? It irks me to no end to have ads or windows or widgets popping up, not to mention having my browser window resized. For the past few years I've been using the NoScript add-on with FF so that I only have to deal with it if I want to. Bev From lists at nopersonal.info Sun Aug 30 11:44:11 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 11:44:11 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9A9D5F.9090404@nopersonal.info> References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> <4A9A92B5.1030907@nopersonal.info> <4A9A9480.1020002@nopersonal.info> <4A9A9D5F.9090404@nopersonal.info> Message-ID: <4A9A9E4B.5010502@nopersonal.info> > tedd wrote: >> While you don't validate client-side, you certainly can confirm and >> therein lies it's usefulness. >> >> Take this for example: >> >> http://webbytedd.com/c/form-calc/ >> >> That would be a nightmare to handle just with php. Every tool has it's job. I agree. I didn't mean to imply that I refuse to use it or that I would disregard it even when it's the best option, I just try to avoid it as much as possible. For example, I use it to generate an "are you sure...?" alert when someone wants to delete a database record, for certain menus & slideshows, rollovers, to get the size of a user's browser window, display local time, etc. PHP has helped me understand it a little better, and I've recently gotten some books on DOM scripting & Ajax because I'm well aware that simply disliking something doesn't mean I'm not going to have to deal with it if I intend to continue doing what I'm doing. But it doesn't mean I have to like it. ;) Bev From dirn at dirnonline.com Sun Aug 30 11:51:04 2009 From: dirn at dirnonline.com (Andy Dirnberger) Date: Sun, 30 Aug 2009 11:51:04 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: <4A9A9DEF.6090209@nopersonal.info> References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> <4A9A92B5.1030907@nopersonal.info> <4A9A9A4D.9040104@nopersonal.info> <4A9A9DEF.6090209@nopersonal.info> Message-ID: > Yeah, I know, and I do use it when I feel it's the best option (or > sometimes the only option), but I just intensely dislike it. I know this > is going to sound irrational, but I hate the way it looks. It's fugly. You are not alone in those opinions. There are a lot of people who agree with you. Have you tried using a JavaScript framework? They definitely help eliminate a lot of the clunkiness. ExtJS, jQuery, Prototype, and YUI are a few of the bigs ones. My personal favorite is jQuery. From lists at nopersonal.info Sun Aug 30 12:01:06 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 12:01:06 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <1251641144.26521@coral.he.net> References: <1251641144.26521@coral.he.net> Message-ID: <4A9AA242.8070006@nopersonal.info> Kristina D. H. Anderson wrote: > Bev, > > Good morning to you as well! I'd imagine that yes, the table-creation > widget inside phpMyAdmin probably does execute the queries that way, as > that seems to be its default mode. I'm not sure if you can change > settings to remove that behavior... I don't know if it can be changed either, but I'm certainly going to be more careful from now on. > There are a lot of reasons to like phpMyAdmin (well, a few reasons at > least) but also a lot of reasons to hate it. For instance, once the > database reaches a certain size, you won't be able to back it up using > phpMyAdmin, but will have to use the command line. That's sort of lame. > > At the bare minimum, if you're going to use phpMyAdmin to create > tables, do it in raw SQL instead of using the widget. I'll have to try that. I think I'm also going to see if I can talk my employer into getting paying for Navicat. It caught the table naming issue right away, so that's a plus. Besides, having a tool that allows me to see a graphic representation of my table relationships helps tremendously as I need to see things in order to learn & retain them. > PS I'm wondering what my mother would say if she knew I spent basically > my entire weekend talking about databases..."that's no way to find a > husband, Kristina" is what she'd probably say...and she's probably > right. Lucky thing I'm not looking for one....! LOL! Hey, I'm 47, contentedly divorced, spend all my time on the computer smoking & drinking coffee, and my only house mates are my two cats. I think I'm well on my way to being that weird old lady that all the kids in the neighborhood are afraid of. :) Bev From lists at nopersonal.info Sun Aug 30 12:08:15 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 12:08:15 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: References: <1251598145.24962@coral.he.net> <20090830040543.GB2118@panix.com> <4A9A890A.9000403@nopersonal.info> <4A9A92B5.1030907@nopersonal.info> <4A9A9A4D.9040104@nopersonal.info> <4A9A9DEF.6090209@nopersonal.info> Message-ID: <4A9AA3EF.8060905@nopersonal.info> Andy Dirnberger wrote: >> I know this >> is going to sound irrational, but I hate the way it looks. It's fugly. > > You are not alone in those opinions. There are a lot of people who > agree with you. Ha! So I'm not crazy after all. > Have you tried using a JavaScript framework? They definitely help > eliminate a lot of the clunkiness. ExtJS, jQuery, Prototype, and YUI > are a few of the bigs ones. My personal favorite is jQuery. jQuery is my favorite too. I started using it about a year ago and now I don't know how I ever lived without it. It has made my life a heck of a lot easier. Bev From lists at nopersonal.info Sun Aug 30 12:14:26 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 12:14:26 -0400 Subject: [nycphp-talk] Need help understanding NULL In-Reply-To: References: <1251598145.24962@coral.he.net> <4A99ED57.3060309@nopersonal.info> Message-ID: <4A9AA562.2080804@nopersonal.info> tedd wrote: > At 11:09 PM -0400 8/29/09, lists at nopersonal.info wrote: >> *wonders if this programming stuff is ever going to get easier* > > Not any easier, but more enjoyable. True, that. The things that I do have a firm grip on now have actually become pretty fun to play around with. > Once you figure out how to hold a hammer, you can beat the crap out of a > lot of stuff while learning what a screwdriver is used for. Then with > hammer and screw driver in hand, you can do some serious damage while > learning what other tools do. > > Eventually you can get to building your first bird house, then shed, and > then home. Like everything else, it takes time. Enjoy the trip. Love the analogy. Bev From lists at nopersonal.info Sun Aug 30 12:40:27 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Sun, 30 Aug 2009 12:40:27 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: References: <1251578829.5291@coral.he.net> <4A99D1C6.8020606@nopersonal.info> <20090830031616.GA10697@panix.com> <4A9A0BC2.4080504@nopersonal.info> Message-ID: <4A9AAB7B.3090209@nopersonal.info> tedd wrote: > True, you're not handling the date thing correctly, but you're close. > > You need to understand how the date was entered into the database. > > Check out: > > http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date > > and review the DATE and NOW functions. > > Once you find out the format of how the date was recorded, then you can > figure out how to extract and use the date for calculating your > expiration date. Oooo, good page. Kind of bit scary looking, but good nonetheless. > As for verbosity, I'm all for it if it's in the name of clarity. You > don't need to be cryptic for your code to work. Just the opposite, take > whatever steps you think you need to detail what you are doing. > > I often start with a simple statement telling what I expect the > following code to do, such as: > > // This extracts the full name of the tutor from the database > > and then I write code to do that. Each step is clearly laid out with > documentation. If I have to use extra variables to understand what's > going on, that's not a big deal in my book, but clarity is. Pretty much every line of my code is commented--if it wasn't I'd never remember how to do anything from one day to the next--I only took out the comments because I didn't want to bore you guys with it. I feel better knowing that it's okay to be verbose, so thanks for that. > Take your time, think things out, and organize your code into small > solution for small problems. Understand each step. Eventually, the > bigger problems will reduce into small problems and you'll find you've > finished. And you've finished you will understand what it does. I think that may be where I've often been going wrong--i.e. I try to think about all of it at once, then I get confused and panic. Great advice; thanks. > Normalizing tables is not intuitive, or at least it was not for me. The > simple rule is to not duplicate data in your database. For example, if > you have a Customer table that holds the name and address of someone and > a Purchase table shows what the person purchased, then you do not have > to repeat the name and address field in the Purchase table. Instead, you > use the index of the person from the Customer table to identify them, > such as: > > Customer table > id first_name last_name address > 345 Bev Woohoo 123 Tulip > > Item table > id item_name cost > 1576 Hair Setter 39.95 > > Purchase table > id customer_id item_purchased > 2003 345 1576 > > If you will review the above tables, you will see that by looking at the > Purchase table, you can deduce the customer 345 (you), purchased item > 1576 (Hair Setter) for $38.95. Neat huh? > > Of course, you can add things like inventory to the Item table and date > of purchase to the Purchase table, and zip code to the Customer table, > but this example was simply to show you how these three tables can be > used to provide the data you want without repeating the data anywhere. > Everything is done via indexes. > > --- Good stuff. Lack of normalization has cause me a lot of grief so far. I've been doing some additional reading on it and I'm starting to understand it a little, but every new example helps. >> I'm currently trying to redo everything, but with limited success as >> trying to grope my way through the fog of my inexperience results in >> frequent rounds of tripping & falling face-first into the mud. I >> eventually figure stuff out and inch my way up a little, but it's a >> slow, painful climb. > > If you know some other way, please let me know because that's the way I > learn. > > ----- I wish I knew another way. No, that's a lie--I enjoy learning. The more difficult the challenge, the greater the feeling of accomplishment when you finally get it right. >> Sometimes I sort of feel like Sisyphus. *sigh* > > Try Penicillin -- I hear that works. :-) LOL Bev From danielc at analysisandsolutions.com Mon Aug 31 00:28:00 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 31 Aug 2009 00:28:00 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: References: <1251641144.26521@coral.he.net> Message-ID: <20090831042800.GA17263@panix.com> On Sun, Aug 30, 2009 at 10:37:33AM -0400, Andy Dirnberger wrote: > > If you are > afraid that you might use a reserved keyword for a field name, use the > ` delimiters around the name of the field in your queries. Which is exactly what started this subthread. Delimiting identifiers is a bad practice that creates way more headaches than it solves. Of course, feel free to stick to it. I'll just pray I never get called in to clean up your code. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From dirn at dirnonline.com Mon Aug 31 00:36:45 2009 From: dirn at dirnonline.com (Andy Dirnberger) Date: Mon, 31 Aug 2009 00:36:45 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <20090831042800.GA17263@panix.com> References: <1251641144.26521@coral.he.net> <20090831042800.GA17263@panix.com> Message-ID: On Mon, Aug 31, 2009 at 12:28 AM, Daniel Convissor wrote: > > On Sun, Aug 30, 2009 at 10:37:33AM -0400, Andy Dirnberger wrote: > > > > If you are > > afraid that you might use a reserved keyword for a field name, use the > > ` delimiters around the name of the field in your queries. > > Which is exactly what started this subthread. ?Delimiting identifiers is > a bad practice that creates way more headaches than it solves. ?Of > course, feel free to stick to it. ?I'll just pray I never get called in > to clean up your code. > > --Dan > I'll pray that, too, because you'd be the first. From leam at reuel.net Mon Aug 31 06:20:28 2009 From: leam at reuel.net (Leam Hall) Date: Mon, 31 Aug 2009 06:20:28 -0400 Subject: [nycphp-talk] OOP, Frameworks, ONLAMP, and NYPHP In-Reply-To: <4A99B2EB.4010606@nopersonal.info> References: <4A950762.6050000@reuel.net> <086f01ca27ea$96e9b690$c4bd23b0$@com> <4A998118.9050003@nopersonal.info> <00b201ca28f9$43e04760$cba0d620$@com> <4A99B2EB.4010606@nopersonal.info> Message-ID: <4A9BA3EC.3070003@reuel.net> So Bev, you taking the lead? Leam lists at nopersonal.info wrote: > > Hans, this sounds great. Your other email just came in, so I'm going to > sign up for the Org list and then I'll read through what you sent. > > Regards, > Bev From lists at nopersonal.info Mon Aug 31 07:18:11 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Mon, 31 Aug 2009 07:18:11 -0400 Subject: [nycphp-talk] OOP, Frameworks, ONLAMP, and NYPHP In-Reply-To: <4A9BA3EC.3070003@reuel.net> References: <4A950762.6050000@reuel.net> <086f01ca27ea$96e9b690$c4bd23b0$@com> <4A998118.9050003@nopersonal.info> <00b201ca28f9$43e04760$cba0d620$@com> <4A99B2EB.4010606@nopersonal.info> <4A9BA3EC.3070003@reuel.net> Message-ID: <4A9BB173.5070405@nopersonal.info> Leam Hall wrote: > So Bev, you taking the lead? > > Leam Hi Leam, I'm not sure. I sent an email to Hans saying I'd be happy to help in whatever capacity I can, so I'm waiting hear back from him. Do you want to help too? If so, I think we're supposed to discuss things over on the Org list. Bev From lists at zaunere.com Mon Aug 31 08:04:33 2009 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 31 Aug 2009 08:04:33 -0400 Subject: [nycphp-talk] OOP, Frameworks, ONLAMP, and NYPHP In-Reply-To: <4A9BB173.5070405@nopersonal.info> References: <4A950762.6050000@reuel.net> <086f01ca27ea$96e9b690$c4bd23b0$@com> <4A998118.9050003@nopersonal.info> <00b201ca28f9$43e04760$cba0d620$@com> <4A99B2EB.4010606@nopersonal.info> <4A9BA3EC.3070003@reuel.net> <4A9BB173.5070405@nopersonal.info> Message-ID: <074301ca2a33$3435cc00$9ca16400$@com> Good morning, > > So Bev, you taking the lead? > > > > Leam > > Hi Leam, > > I'm not sure. I sent an email to Hans saying I'd be happy to help in > whatever capacity I can, so I'm waiting hear back from him. Sorry, I need to call roto router on my inbox... > Do you want to help too? If so, I think we're supposed to discuss things > over on the Org list. The more the merrier - certainly more than one person involved would be a good thing. Yeah, let's head over to the Org list since this one is getting enough traffic as it is and I'll follow-up later today (anyone else is welcomed to swing over too). H From ka at kacomputerconsulting.com Mon Aug 31 08:22:30 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Mon, 31 Aug 2009 05:22:30 -0700 Subject: [nycphp-talk] naming identifiers Message-ID: <1251721350.28247@coral.he.net> I was trained from the get-go back when I was using Access and SQL Server in the 90s to never, ever use reserved words for table or field names...and also to never use just "id" for the primary key field name. I'm wondering why both phpMyAdmin and a number of the boilerplate PHP5 frameworks' database code bases that I've seen all seem to be pushing the use of these delimiters around really, every single table and field name at all times, whether required or not. I hadn't given it much thought until this thread but the amount of them that I've seen over the past year or so has skyrocketed. In all honesty I didn't give much thought, either, to exactly why they were there and just removed them due to my longstanding habits in writing queries. To my mind, for phpMyAdmin and code frameworks out there to be promoting what is, no matter how you frame it, nearly universally considered bad practice, by promiscuously using these delimiters everywhere is just scary. Is there some push on the part of MySQL to require these delimiters as a matter of course in some future version, or...? Kristina > On Mon, Aug 31, 2009 at 12:28 AM, Daniel Convissor > wrote: > > > > On Sun, Aug 30, 2009 at 10:37:33AM -0400, Andy Dirnberger wrote: > > > > > > If you are > > > afraid that you might use a reserved keyword for a field name, use the > > > ` delimiters around the name of the field in your queries. > > > > Which is exactly what started this subthread. ?Delimiting identifiers is > > a bad practice that creates way more headaches than it solves. ?Of > > course, feel free to stick to it. ?I'll just pray I never get called in > > to clean up your code. > > > > --Dan > > > > I'll pray that, too, because you'd be the 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 lists at nopersonal.info Mon Aug 31 10:05:26 2009 From: lists at nopersonal.info (lists at nopersonal.info) Date: Mon, 31 Aug 2009 10:05:26 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <1251721350.28247@coral.he.net> References: <1251721350.28247@coral.he.net> Message-ID: <4A9BD8A6.2080104@nopersonal.info> Kristina D. H. Anderson wrote: > > ...and also to never use just "id" for the primary key field name. > Hi Kristina, I'm probably going OT when I shouldn't, but I'm so glad you mentioned that because I was just wondering about it yesterday. I started out using "id" because it was easy when I needed to use PHP to delete records form different tables and such, but then sometimes it got confusing so I started using names like "prod_id". Besides what I discovered on my own, are there other reasons it's considered bad practice? I'm very interested in knowing. Bev From paul at devonianfarm.com Mon Aug 31 10:29:32 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Mon, 31 Aug 2009 10:29:32 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <00a801ca28f7$1b1f26e0$515d74a0$@com> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> <016601ca2819$9d14cd00$d73e6700$@com> <4A983ABB.6010503@devonianfarm.com> <00a801ca28f7$1b1f26e0$515d74a0$@com> Message-ID: <4A9BDE4C.5090708@devonianfarm.com> Hans Zaunere wrote: > > Yeah something like this could be handy, certainly. I typically push/adapt > an object into the template which is property overloaded. Then something > like: > > FirstName?> > > I'm afraid that this is getting us back to magic_quotes_gpc: because now I might want to write $first_name=$Object->FirstName; and then do something with $first_name that isn't writing it into HTML. magic_quotes_gpc was effective protection against a certain category of HTML injection faults, but it made it difficult to write entirely correct code that processes the content of strings. I prefer the model of "escape at the time of output" rather than preemptive escaping: particularly these days, where you might be escaping a variable to be a Javascript string literal instead of an HTML code. Today people are realizing that HTML/Javascript injection attacks are difficult to stop (there are lots of clever ways to inject Javascript that you'd never think of), and some systems are taking different approaches. ASP.NET, for instance, has an "application firewall" built in that looks for dangerous inputs in form variables and that will abort your application if you get fed junk. Although my first impression is that this is "magic_quotes_gpc all over again", and I've definitely seen the system block legitimate input, Microsoft has done a good job of justifying this behavior. > Outputs correctly escaped (or processed in any other way depending on what > the overload wants to do) content. Quite handy and has proved effective. > > It does seem that it'd be handy to have some type of "stdout" processing > hook that can be overridden, while providing a shorthand for working in > templates. > It makes some people feel dirty, but you can do this with global variables, assuming your template system remembers to set them when you get in or out of a template. My own "php on nails" system has quite a few functions that behave differently if serving a web page or run from the command line. From lists at zaunere.com Mon Aug 31 11:00:56 2009 From: lists at zaunere.com (Hans Zaunere) Date: Mon, 31 Aug 2009 11:00:56 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <4A9BDE4C.5090708@devonianfarm.com> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> <016601ca2819$9d14cd00$d73e6700$@com> <4A983ABB.6010503@devonianfarm.com> <00a801ca28f7$1b1f26e0$515d74a0$@com> <4A9BDE4C.5090708@devonianfarm.com> Message-ID: <07f701ca2a4b$d8157880$88406980$@com> > > Yeah something like this could be handy, certainly. I typically push/adapt > > an object into the template which is property overloaded. Then something > > like: > > > > FirstName?> > > I'm afraid that this is getting us back to magic_quotes_gpc: Negative - magic_* is global type behavior that's automatic - evil... > because now I might want to write > > $first_name=$Object->FirstName; > > and then do something with $first_name that isn't writing it into > HTML. magic_quotes_gpc was effective protection against a certain But you'd always be writing into HTML. The escaping as it's done above is only after a regular data object has been adapted/pushed into an HTML template. The original data is never changed, and the escaping is use case specific. Back in my model/controller, my data object gives raw data, just as it's stored. I could write an adapter and push data in, that let's say, is for SQL - JSON - CSV - XML - etc. Each adapter would wrap the data as appropriate. If I had an adapter for MySQL SQL generation and one for Oracle SQL generation, they would even escape things differently, based on the type of SQL (and connection resource/charset/etc in fact). Very different from magic_* > category of HTML injection faults, but it made it difficult to write > entirely correct code that processes the content of strings. I prefer > the model of "escape at the time of output" rather than preemptive > escaping: particularly these days, where you might be escaping a > variable to be a Javascript string literal instead of an HTML code. > > Today people are realizing that HTML/Javascript injection attacks > are difficult to stop (there are lots of clever ways to inject > Javascript that you'd never think of), and some systems are taking > different approaches. ASP.NET, for instance, has an "application > firewall" built in that looks for dangerous inputs in form variables and > that will abort your application if you get fed junk. Although my first > impression is that this is "magic_quotes_gpc all over again", and I've > definitely seen the system block legitimate input, Microsoft has done a > good job of justifying this behavior. No argument with HTML injection being a mess, but the above example is exactly "escape at the time of output" - and escape based on the exact destination, so it's very granular. > > Outputs correctly escaped (or processed in any other way depending on what > > the overload wants to do) content. Quite handy and has proved effective. > > > > It does seem that it'd be handy to have some type of "stdout" processing > > hook that can be overridden, while providing a shorthand for working in > > templates. > > It makes some people feel dirty, but you can do this with global > variables, assuming your template system remembers to set them when you > get in or out of a template. My own "php on nails" system has quite a Mine does - they aren't "global" but scoped only for that template. When an object is pushed in, it's adapted/wrapped with an object that is designed specifically for output in whatever type of template I'm dealing with. > few functions that behave differently if serving a web page or run from > the command line. Ditto - PHP on nails, I like that... H From sequethin at gmail.com Mon Aug 31 11:08:32 2009 From: sequethin at gmail.com (sequethin at gmail.com) Date: Mon, 31 Aug 2009 15:08:32 +0000 Subject: [nycphp-talk] Need help understanding NULL Message-ID: <955111085-1251731473-cardhu_decombobulator_blackberry.rim.net-347125429-@bda410.bisx.prod.on.blackberry> Late to this party, but something I find useful wrt to NULL is that php's isset() will return FALSE if a variable is NULL. It would return TRUE if the same variable was set to 0 or empty string. --Mike H PS sorry for the top post my blackberry is being a PITA ------Original Message------ From: lists at nopersonal.info Sender: talk-bounces at lists.nyphp.org To: NYPHP Talk ReplyTo: NYPHP Talk Subject: Re: [nycphp-talk] Need help understanding NULL Sent: Aug 30, 2009 10:12 AM Hans Zaunere wrote: > NULL is just a type - a type that can only ever be one thing - NULL I think I get that part now: The moment it has a known value, even if that value is '' or zero, then it's no longer NULL (at least in the world according to MySQL). > NULL comes from pointers, largely where there can be null references > or pointers. It's an address that doesn't point anywhere, but is > some way pointed to and acknowledged, thus it's not purely > non-existent (yes, we could argue for years on the subtle meanings of > NULL, void, undefined, etc. :) Hans, you're going to make my head explode. LOL > As always, there's only one real resource these days: > > http://en.wikipedia.org/wiki/Null Oddly, while I go to Wikipedia probably a dozen times a day for answers, it never occurred to me to look up NULL there. Go figure. > To me, pragmatically, NULL really only comes down to one thing - it's > a special type that always has a single value. Different languages > and environments then utilize this type differently, and add their > own meanings. Thus you need to read the different environment's docs > to learn how NULL is treated specifically in that environment, and > how it affects getting things down in that environment. There is no > "global" real meaning of NULL - it's language specific. Noted. > Other than that NULL is meaningless - it's NULL :) Bev :) _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php Sent via BlackBerry from T-Mobile From paul at devonianfarm.com Mon Aug 31 13:36:44 2009 From: paul at devonianfarm.com (Paul A Houle) Date: Mon, 31 Aug 2009 13:36:44 -0400 Subject: [nycphp-talk] Short Tags deprecated? In-Reply-To: <07f701ca2a4b$d8157880$88406980$@com> References: <4A9818B4.1060005@devonianfarm.com> <68de37340908281132h63ee11deq986156b5ef725e1c@mail.gmail.com> <68de37340908281233j69ffb293j19b4c75b6ee2469a@mail.gmail.com> <016601ca2819$9d14cd00$d73e6700$@com> <4A983ABB.6010503@devonianfarm.com> <00a801ca28f7$1b1f26e0$515d74a0$@com> <4A9BDE4C.5090708@devonianfarm.com> <07f701ca2a4b$d8157880$88406980$@com> Message-ID: <4A9C0A2C.2040305@devonianfarm.com> Hans Zaunere wrote: > > Mine does - they aren't "global" but scoped only for that template. When an > object is pushed in, it's adapted/wrapped with an object that is designed > specifically for output in whatever type of template I'm dealing with. > > That could work well, but I do have some fear that a person who's familliar with the framework wouldn't get into the html escaping habit when they write some script that depends on it. I also have times that I do string manipulation in a template (or use a function that does string manipulation), and in those cases, getting stuff escaped out of the data layer would be a distraction. I often find myself developing tiny things that don't fit entirely into a framework and it's nice to have conventions that make it easier to do the right thing with or without a framework. >> few functions that behave differently if serving a web page or run from >> the command line. >> > > Ditto - PHP on nails, I like that... > "Nails" is a library, not a framework. Every language makes programmers prone to certain mistakes; goal #1 of nails is to provide simple answers to the simple problems that bug PHP programmers day in and day out. For instance, there are G() and P() functions to get GET and POST variables that undo magic_quotes_gpc if it's turned on. On top of that I've got a few "framework" stacks that I can put on for particular sorts of work... However, nails improves the readability and reliability of even the simplest scripts, so long as it doesn't run into a namespace conflict. From dorgan at donaldorgan.com Mon Aug 31 13:46:42 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Mon, 31 Aug 2009 13:46:42 -0400 (EDT) Subject: [nycphp-talk] Magento Commerce Experience Message-ID: <10856982.3941251740802429.JavaMail.root@twoguyshosting.com.> Does anyone on the list have experience with Magento Commerce http://www.magentocommerce.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmcgraw1 at gmail.com Mon Aug 31 13:58:27 2009 From: jmcgraw1 at gmail.com (Jake McGraw) Date: Mon, 31 Aug 2009 13:58:27 -0400 Subject: [nycphp-talk] Magento Commerce Experience In-Reply-To: <10856982.3941251740802429.JavaMail.root@twoguyshosting.com.> References: <10856982.3941251740802429.JavaMail.root@twoguyshosting.com.> Message-ID: It has a steep learning curve and can be very slow at times. That considered, it is designed in an incredibly modular manner, so you can pretty much provide an alternate module for any built-in code, so, it's highly customizable. It has one of the organized code bases I've ever seen. - jake On Mon, Aug 31, 2009 at 1:46 PM, Donald J. Organ IV wrote: > Does anyone on the list have experience with Magento Commerce > http://www.magentocommerce.com > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > From dorgan at donaldorgan.com Mon Aug 31 14:20:53 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Mon, 31 Aug 2009 14:20:53 -0400 (EDT) Subject: [nycphp-talk] Magento Commerce Experience In-Reply-To: Message-ID: <24260420.3971251742853689.JavaMail.root@twoguyshosting.com.> Yes I've already developed a module that provides alternate code for built-in code...but the problem I am having is that I am trying to update the totals, grand totals, tax totals, for orders and quotes but it seems like i set the value inside of one object..then inside another object I try to get the value that was previously set and its the original magento value and not my newly specified value. ----- Original Message ----- From: "Jake McGraw" To: "NYPHP Talk" Sent: Monday, August 31, 2009 1:58:27 PM Subject: Re: [nycphp-talk] Magento Commerce Experience It has a steep learning curve and can be very slow at times. That considered, it is designed in an incredibly modular manner, so you can pretty much provide an alternate module for any built-in code, so, it's highly customizable. It has one of the organized code bases I've ever seen. - jake On Mon, Aug 31, 2009 at 1:46 PM, Donald J. Organ IV wrote: > Does anyone on the list have experience with Magento Commerce > http://www.magentocommerce.com > > > _______________________________________________ > 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 chuck.reeves at gmail.com Mon Aug 31 15:49:35 2009 From: chuck.reeves at gmail.com (Chuck Reeves) Date: Mon, 31 Aug 2009 15:49:35 -0400 Subject: [nycphp-talk] Magento Commerce Experience In-Reply-To: <24260420.3971251742853689.JavaMail.root@twoguyshosting.com.> References: <24260420.3971251742853689.JavaMail.root@twoguyshosting.com.> Message-ID: be sure to call the save method after you call the set. ex $myOrder = Mage::getModel('sales/order'); $myOrder->load($orderId); $myOrder->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Order Processing Started '); //any other set method will work here $myOrder->save(); Thank You Chuck Reeves Cell: 631-374-0772 Email: chuck.reeves at gmail.com On Mon, Aug 31, 2009 at 2:20 PM, Donald J. Organ IV wrote: > Yes I've already developed a module that provides alternate code for > built-in code...but the problem I am having is that I am trying to update > the totals, grand totals, tax totals, for orders and quotes but it seems > like i set the value inside of one object..then inside another object I try > to get the value that was previously set and its the original magento value > and not my newly specified value. > > > > > > ----- Original Message ----- > From: "Jake McGraw" > To: "NYPHP Talk" > Sent: Monday, August 31, 2009 1:58:27 PM > Subject: Re: [nycphp-talk] Magento Commerce Experience > > It has a steep learning curve and can be very slow at times. That > considered, it is designed in an incredibly modular manner, so you can > pretty much provide an alternate module for any built-in code, so, > it's highly customizable. It has one of the organized code bases I've > ever seen. > > - jake > > On Mon, Aug 31, 2009 at 1:46 PM, Donald J. Organ > IV wrote: > > Does anyone on the list have experience with Magento Commerce > > http://www.magentocommerce.com > > > > > > _______________________________________________ > > 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 mona.borham at webworxcorp.com Mon Aug 31 15:58:15 2009 From: mona.borham at webworxcorp.com (Mona Borham) Date: Mon, 31 Aug 2009 22:58:15 +0300 Subject: [nycphp-talk] Magento Commerce Experience In-Reply-To: References: <24260420.3971251742853689.JavaMail.root@twoguyshosting.com.> Message-ID: Yeah what exactlly you wanna know? Mona Borham Web Developer On Mon, Aug 31, 2009 at 10:49 PM, Chuck Reeves wrote: > be sure to call the save method after you call the set. > > ex > $myOrder = Mage::getModel('sales/order'); > $myOrder->load($orderId); > $myOrder->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Order > Processing Started '); //any other set method will work here > $myOrder->save(); > > Thank You > Chuck Reeves > Cell: 631-374-0772 > Email: chuck.reeves at gmail.com > > > > On Mon, Aug 31, 2009 at 2:20 PM, Donald J. Organ IV < > dorgan at donaldorgan.com> wrote: > >> Yes I've already developed a module that provides alternate code for >> built-in code...but the problem I am having is that I am trying to update >> the totals, grand totals, tax totals, for orders and quotes but it seems >> like i set the value inside of one object..then inside another object I try >> to get the value that was previously set and its the original magento value >> and not my newly specified value. >> >> >> >> >> >> ----- Original Message ----- >> From: "Jake McGraw" >> To: "NYPHP Talk" >> Sent: Monday, August 31, 2009 1:58:27 PM >> Subject: Re: [nycphp-talk] Magento Commerce Experience >> >> It has a steep learning curve and can be very slow at times. That >> considered, it is designed in an incredibly modular manner, so you can >> pretty much provide an alternate module for any built-in code, so, >> it's highly customizable. It has one of the organized code bases I've >> ever seen. >> >> - jake >> >> On Mon, Aug 31, 2009 at 1:46 PM, Donald J. Organ >> IV wrote: >> > Does anyone on the list have experience with Magento Commerce >> > http://www.magentocommerce.com >> > >> > >> > _______________________________________________ >> > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From monalisa20042006 at gmail.com Mon Aug 31 15:58:44 2009 From: monalisa20042006 at gmail.com (Mona Borham) Date: Mon, 31 Aug 2009 22:58:44 +0300 Subject: [nycphp-talk] Magento Commerce Experience In-Reply-To: References: <24260420.3971251742853689.JavaMail.root@twoguyshosting.com.> Message-ID: > > Yeah what exactlly you wanna know? > > Mona Borham > Web Developer > > > > On Mon, Aug 31, 2009 at 10:49 PM, Chuck Reeves wrote: > >> be sure to call the save method after you call the set. >> >> ex >> $myOrder = Mage::getModel('sales/order'); >> $myOrder->load($orderId); >> $myOrder->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Order >> Processing Started '); //any other set method will work here >> $myOrder->save(); >> >> Thank You >> Chuck Reeves >> Cell: 631-374-0772 >> Email: chuck.reeves at gmail.com >> >> >> >> On Mon, Aug 31, 2009 at 2:20 PM, Donald J. Organ IV < >> dorgan at donaldorgan.com> wrote: >> >>> Yes I've already developed a module that provides alternate code for >>> built-in code...but the problem I am having is that I am trying to update >>> the totals, grand totals, tax totals, for orders and quotes but it seems >>> like i set the value inside of one object..then inside another object I try >>> to get the value that was previously set and its the original magento value >>> and not my newly specified value. >>> >>> >>> >>> >>> >>> ----- Original Message ----- >>> From: "Jake McGraw" >>> To: "NYPHP Talk" >>> Sent: Monday, August 31, 2009 1:58:27 PM >>> Subject: Re: [nycphp-talk] Magento Commerce Experience >>> >>> It has a steep learning curve and can be very slow at times. That >>> considered, it is designed in an incredibly modular manner, so you can >>> pretty much provide an alternate module for any built-in code, so, >>> it's highly customizable. It has one of the organized code bases I've >>> ever seen. >>> >>> - jake >>> >>> On Mon, Aug 31, 2009 at 1:46 PM, Donald J. Organ >>> IV wrote: >>> > Does anyone on the list have experience with Magento Commerce >>> > http://www.magentocommerce.com >>> > >>> > >>> > _______________________________________________ >>> > 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 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorgan at donaldorgan.com Mon Aug 31 16:26:14 2009 From: dorgan at donaldorgan.com (Donald J. Organ IV) Date: Mon, 31 Aug 2009 16:26:14 -0400 (EDT) Subject: [nycphp-talk] Magento Commerce Experience In-Reply-To: Message-ID: <25501375.4031251750374357.JavaMail.root@twoguyshosting.com.> When i do $myOrder->save(); it seems to be taking all the values that I just set and setting them back. ----- Original Message ----- From: "Chuck Reeves" To: "NYPHP Talk" Sent: Monday, August 31, 2009 3:49:35 PM Subject: Re: [nycphp-talk] Magento Commerce Experience be sure to call the save method after you call the set. ex $myOrder = Mage::getModel('sales/order'); $myOrder->load($orderId); $myOrder->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Order Processing Started '); //any other set method will work here $myOrder->save(); Thank You Chuck Reeves Cell: 631-374-0772 Email: chuck.reeves at gmail.com On Mon, Aug 31, 2009 at 2:20 PM, Donald J. Organ IV < dorgan at donaldorgan.com > wrote: Yes I've already developed a module that provides alternate code for built-in code...but the problem I am having is that I am trying to update the totals, grand totals, tax totals, for orders and quotes but it seems like i set the value inside of one object..then inside another object I try to get the value that was previously set and its the original magento value and not my newly specified value. ----- Original Message ----- From: "Jake McGraw" < jmcgraw1 at gmail.com > To: "NYPHP Talk" < talk at lists.nyphp.org > Sent: Monday, August 31, 2009 1:58:27 PM Subject: Re: [nycphp-talk] Magento Commerce Experience It has a steep learning curve and can be very slow at times. That considered, it is designed in an incredibly modular manner, so you can pretty much provide an alternate module for any built-in code, so, it's highly customizable. It has one of the organized code bases I've ever seen. - jake On Mon, Aug 31, 2009 at 1:46 PM, Donald J. Organ IV< dorgan at donaldorgan.com > wrote: > Does anyone on the list have experience with Magento Commerce > http://www.magentocommerce.com > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ka at kacomputerconsulting.com Mon Aug 31 21:06:22 2009 From: ka at kacomputerconsulting.com (Kristina D. H. Anderson) Date: Mon, 31 Aug 2009 18:06:22 -0700 Subject: [nycphp-talk] naming identifiers Message-ID: <1251767182.2728@coral.he.net> Bev, Essentially the thinking is that whenever you're processing code that involves a lot of tables or a lot of queries (and returned results), you end up with a bucketload of things named 'id' to handle. For instance imagine pulling out the contents of ten tables through ten queries in one script, and all the ID fields are named, id. Or if you are doing a SELECT query where you are pulling stuff from 3 tables at once and all three of them have a field that you need to reference named, you guessed it, id in all three cases. The thinking being that if you don't name everything 'id' then you won't make mistakes caused by everything being named 'id'. The flipside of the argument is that it gets darn annoying always forgetting whether or not in this table the ID is prodid or prod_id or productid or whatever it may be...and you're looking it up for the 6th time that day at 2 AM.... Or you inherit a database that's got fun ID field names like cat_subCat_xtab_id and you start cursing the day that someone came up with the silly idea that naming ID fields 'id' was a bad idea...When you start muttering things like "this is a database, not the Iowa Writer's Workshop" under your breath, you know it's time to leave and get that cold beer. And you've got to be consistent with your own database design. If you decide now to go with prod_id, stick with that, don't all of a sudden start to think that the underscore is "so last year", and start to use prodid...so you don't get confused between databases. I've been guilty of getting bored with using the same old, same old field names over and over and making my life more difficult than it has to be... I've tended to think over the years that this "rule" has significant points both for and against. Kristina > Kristina D. H. Anderson wrote: > > > > ...and also to never use just "id" for the primary key field name. > > > > Hi Kristina, > > I'm probably going OT when I shouldn't, but I'm so glad you mentioned > that because I was just wondering about it yesterday. I started out > using "id" because it was easy when I needed to use PHP to delete > records form different tables and such, but then sometimes it got > confusing so I started using names like "prod_id". > > Besides what I discovered on my own, are there other reasons it's > considered bad practice? I'm very interested in knowing. > > Bev > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show_participation.php > > From danielc at analysisandsolutions.com Mon Aug 31 22:26:26 2009 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 31 Aug 2009 22:26:26 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <1251767182.2728@coral.he.net> References: <1251767182.2728@coral.he.net> Message-ID: <20090901022626.GA7920@panix.com> Folks: Folks: On Mon, Aug 31, 2009 at 06:06:22PM -0700, Kristina D. H. Anderson wrote: > For instance imagine pulling out the contents of ten tables through ten > queries in one script, and all the ID fields are named, id. So true. Using "id" as the primary keys means you need to make aliases in queries over and over and over. Then there's the possibility of having inconsistently named aliases for the same field in different queries, so it's hard to remember what you're dealing with inside your PHP code. Most importantly, if you name everything "id," then you have to explicitly spell out your JOIN statements in an ON clause SELECT product_name, vendor_name FROM product JOIN vendor ON (vendor.id = product.vendor_id) When it's so much easier to take advantage of USING clause: SELECT product_name, vendor_name FROM product JOIN vendor USING (vendor_id) > The flipside of the argument is that it gets darn annoying always > forgetting whether or not in this table the ID is prodid or prod_id or > productid or whatever it may be. And that's where a thorough naming standards come in. Name tables singluar (person, pet, product, etc). Name the primary key field _id. No guessing involved. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From michael.southwell at nyphp.com Mon Aug 31 23:33:26 2009 From: michael.southwell at nyphp.com (Michael Southwell) Date: Mon, 31 Aug 2009 23:33:26 -0400 Subject: [nycphp-talk] naming identifiers In-Reply-To: <20090901022626.GA7920@panix.com> References: <1251767182.2728@coral.he.net> <20090901022626.GA7920@panix.com> Message-ID: <4A9C9606.8030309@nyphp.com> Daniel Convissor wrote: > PHP code. Most importantly, if you name everything "id," then you have > to explicitly spell out your JOIN statements in an ON clause > > SELECT product_name, vendor_name > FROM product > JOIN vendor ON (vendor.id = product.vendor_id) > > When it's so much easier to take advantage of USING clause: > > SELECT product_name, vendor_name > FROM product > JOIN vendor USING (vendor_id) It's always seemed easier and clearer to me to use WHERE instead of JOIN (where the table IDs are indeed named id, and the foreign keys are labeled with the table name): SELECT product_name, vendor_name FROM product, vendor WHERE vendor.id = product.vendor_id but maybe that's just my ignorance -- ================= Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth