From ka at kacomputerconsulting.com Sun Mar 10 04:45:18 2013 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Sun, 10 Mar 2013 00:45:18 -0800 (PST) Subject: [nycphp-talk] really need some help Message-ID: <2505.72.229.162.69.1362905118.squirrel@www.kacomputerconsulting.com> Guys, I hate to do this but I am so desperate right now, I really need an extra set of eyes with a project that needs to be finished today. Please contact me ASAP if you can help. I am definitely willing to pay you. This is PHP/AJAX and involves times that auctions start and displaying the auctions and I just broke something again... Thanks in advance. Kristina -- Kristina Anderson PHP / MySQL / AJAX / etc / Systems Analyst / Programmer / Consultant 718 726 8566 From zaunere at gmail.com Mon Mar 11 08:57:34 2013 From: zaunere at gmail.com (Hans Z) Date: Mon, 11 Mar 2013 08:57:34 -0400 Subject: [nycphp-talk] TEST Message-ID: Hello all, Seems as though there was a problem with mailman... hopefully it's fixed and this gets through. H From ka at kacomputerconsulting.com Mon Mar 11 09:05:11 2013 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Mon, 11 Mar 2013 06:05:11 -0700 (PDT) Subject: [nycphp-talk] TEST In-Reply-To: References: Message-ID: <4107.72.229.162.69.1363007111.squirrel@kacomputerconsulting.com> Yesterday the whole domain was unreachable from what I saw, I was wondering what happened. On Mon, March 11, 2013 5:57 am, Hans Z wrote: > Hello all, > > > Seems as though there was a problem with mailman... hopefully it's > fixed and this gets through. > > H > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > > http://www.nyphp.org/show-participation > > > -- Kristina Anderson PHP / MySQL / AJAX / etc / Systems Analyst / Programmer / Consultant 718 726 8566 From ka at kacomputerconsulting.com Sun Mar 10 04:54:18 2013 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Sun, 10 Mar 2013 00:54:18 -0800 (PST) Subject: [nycphp-talk] assistance needed desperately today Message-ID: <2619.72.229.162.69.1362905658.squirrel@kacomputerconsulting.com> Hi guys, I hate to do this but I am truly desperate. I need some assistance and an extra pair of eyes today ASAP to finish a project and get rid of a difficult client. I am willing to pay. Please contact me ASAP if you can help me. -- Kristina Anderson PHP / MySQL / AJAX / etc / Systems Analyst / Programmer / Consultant 718 726 8566 From csc111vs at gmail.com Mon Mar 11 09:06:12 2013 From: csc111vs at gmail.com (Sarath chandra) Date: Mon, 11 Mar 2013 18:36:12 +0530 Subject: [nycphp-talk] really need some help In-Reply-To: <2505.72.229.162.69.1362905118.squirrel@www.kacomputerconsulting.com> References: <2505.72.229.162.69.1362905118.squirrel@www.kacomputerconsulting.com> Message-ID: Hi Kristina, I would definitely like to help you in your project. Presently I am building the app for gifthelp.us In case you are interested to look in to the development url I will share you. If you are looking for help in AJAX, Javascript and PHP. please do reply me. Thanks Sarath On Sun, Mar 10, 2013 at 2:15 PM, Kristina Anderson < ka at kacomputerconsulting.com> wrote: > Guys, I hate to do this but I am so desperate right now, I really need an > extra set of eyes with a project that needs to be finished today. Please > contact me ASAP if you can help. I am definitely willing to pay you. > This is PHP/AJAX and involves times that auctions start and displaying the > auctions and I just broke something again... > > Thanks in advance. > > Kristina > > > -- > Kristina Anderson > PHP / MySQL / AJAX / etc / Systems Analyst / Programmer / Consultant > 718 726 8566 > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -- Thanks and Regards, Sarath Chandra. View my public profile -------------- next part -------------- An HTML attachment was scrubbed... URL: From ka at kacomputerconsulting.com Mon Mar 11 09:07:12 2013 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Mon, 11 Mar 2013 06:07:12 -0700 (PDT) Subject: [nycphp-talk] assistance needed desperately today In-Reply-To: <2619.72.229.162.69.1362905658.squirrel@kacomputerconsulting.com> References: <2619.72.229.162.69.1362905658.squirrel@kacomputerconsulting.com> Message-ID: <4130.72.229.162.69.1363007232.squirrel@kacomputerconsulting.com> Hi everyone, sorry to SPAM you with multiple posts but I did not know there was a problem with the list and thought my email didn't go through :) Kristina On Sun, March 10, 2013 1:54 am, Kristina Anderson wrote: > Hi guys, I hate to do this but I am truly desperate. I need some > assistance and an extra pair of eyes today ASAP to finish a project and get > rid of a difficult client. I am willing to pay. Please contact me ASAP > if you can help me. > > > -- > Kristina Anderson > PHP / MySQL / AJAX / etc / Systems Analyst / Programmer / Consultant > 718 726 8566 > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > > http://www.nyphp.org/show-participation > > > -- Kristina Anderson PHP / MySQL / AJAX / etc / Systems Analyst / Programmer / Consultant 718 726 8566 From zaunere at gmail.com Mon Mar 11 09:25:39 2013 From: zaunere at gmail.com (Hans Z) Date: Mon, 11 Mar 2013 09:25:39 -0400 Subject: [nycphp-talk] TALK FINAL TEST Message-ID: Hopefully :) Sorry all, H From meghan at 10gen.com Sat Mar 9 12:43:41 2013 From: meghan at 10gen.com (Meghan Gill) Date: Sat, 9 Mar 2013 12:43:41 -0500 Subject: [nycphp-talk] [events] Open Tech NYC (March 30) + MongoDB NYC (June 21) Message-ID: Hi all - I wanted to give you a heads up about two events that I thought the group might be interested in: On March 30 I am co-organized a conference called Open Tech NYC, which is all about how open source is powering the NYC technology community. We have an amazing lineup of speakers - see http://www.opentech2013.org/#agenda for more info and registration details. On June 21, 10gen is hosting MongoDB NYC, the annual MongoDB conference in NYC. The conference has sold out the past three years so I would book early if you are interested in attending. We're also looking for speakers so if you are interested in sharing your experiences with MongoDB feel free to submit a talk proposalor contact me off-list about getting involved as a speaker. Hope to see some of you at these events! Thanks, Meghan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ka at kacomputerconsulting.com Wed Mar 13 17:59:32 2013 From: ka at kacomputerconsulting.com (Kristina Anderson) Date: Wed, 13 Mar 2013 14:59:32 -0700 (PDT) Subject: [nycphp-talk] one last bug to fix Message-ID: <3615.72.229.162.69.1363211972.squirrel@kacomputerconsulting.com> Just when you thought life couldn't get any more fun, you start your new job, don't have any time to spare, and there's still ONE more bug left to fix on the project (just one, I swear). You've already pissed off a few of your friends, been flaked on by one dude you didn't really know that well who couldn't read the code and cost you another day, and really need someone who can read crappy Indian code and knows AJAX backwards and forwards before you just go crazy once and for all. Payment available within 2 weeks of invoice, when I get my first paycheck! Contact ASAP. -- Kristina Anderson PHP / MySQL / AJAX / etc / Systems Analyst / Programmer / Consultant 718 726 8566 From david at davidmintz.org Fri Mar 15 17:08:57 2013 From: david at davidmintz.org (David Mintz) Date: Fri, 15 Mar 2013 17:08:57 -0400 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach Message-ID: function whatever(Array $array) { foreach ($array as $key => $value) { if ($something) { return true; } } return false; } Is there any reason -- style, legibility, whatever -- not to do the above? Or should you do something like function whatever(Array $array) { $return = false; foreach ($array as $key => $value) { if ($something) { $return = true; break; } } return $return; } Thanks. -- David Mintz http://davidmintz.org/ Fight for social equality: http://socialequality.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Fri Mar 15 17:30:57 2013 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 15 Mar 2013 17:30:57 -0400 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach In-Reply-To: References: Message-ID: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> There are a few things to learn from here. First it is not only a styling thing. In the first one you have several return statements and in the second you only have 1 return statement. It will depend on the code logic but I tend to return when I have the value I need rather than assign it to a variable and have it continue to process through the rest of the function. If you only return after the entire function is complete but your known case was the first check in the function you are "over" processing and will only add time to your sites load time. Thanks, Joseph Crawford On Mar 15, 2013, at 5:08 PM, David Mintz wrote: > function whatever(Array $array) { > > foreach ($array as $key => $value) { > if ($something) { > return true; > } > } > return false; > } > > Is there any reason -- style, legibility, whatever -- not to do the above? Or should you do something like > > function whatever(Array $array) { > > $return = false; > foreach ($array as $key => $value) { > if ($something) { > $return = true; > break; > } > } > return $return; > } > > Thanks. > > > -- > David Mintz > http://davidmintz.org/ > Fight for social equality: > http://socialequality.com/ > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From ircmaxell at gmail.com Fri Mar 15 17:50:04 2013 From: ircmaxell at gmail.com (Anthony Ferrara) Date: Fri, 15 Mar 2013 17:50:04 -0400 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach In-Reply-To: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> References: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> Message-ID: The first is fine. There's no reason not to do it... On Fri, Mar 15, 2013 at 5:30 PM, Joseph Crawford wrote: > There are a few things to learn from here. > > First it is not only a styling thing. In the first one you have several > return > statements and in the second you only have 1 return statement. > > It will depend on the code logic but I tend to return when I have the > value I need rather > than assign it to a variable and have it continue to process through the > rest of the function. > > If you only return after the entire function is complete but your known > case was the first check in > the function you are "over" processing and will only add time to your > sites load time. > > Thanks, > Joseph Crawford > > On Mar 15, 2013, at 5:08 PM, David Mintz wrote: > > function whatever(Array $array) { > > foreach ($array as $key => $value) { > if ($something) { > return true; > } > } > return false; > } > > Is there any reason -- style, legibility, whatever -- not to do the > above? Or should you do something like > > function whatever(Array $array) { > > $return = false; > foreach ($array as $key => $value) { > if ($something) { > $return = true; > break; > } > } > return $return; > } > > Thanks. > > > -- > David Mintz > http://davidmintz.org/ > Fight for social equality: > http://socialequality.com/ > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Fri Mar 15 18:14:42 2013 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 15 Mar 2013 18:14:42 -0400 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach In-Reply-To: References: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> Message-ID: The only reason would be poorly designed code where the return value could change based on multiple separate conditionals. I have seen it in some legacy code. On Mar 15, 2013 5:50 PM, "Anthony Ferrara" wrote: > > The first is fine. There's no reason not to do it... > > > On Fri, Mar 15, 2013 at 5:30 PM, Joseph Crawford wrote: >> >> There are a few things to learn from here. >> >> First it is not only a styling thing. In the first one you have several return >> statements and in the second you only have 1 return statement. >> >> It will depend on the code logic but I tend to return when I have the value I need rather >> than assign it to a variable and have it continue to process through the rest of the function. >> >> If you only return after the entire function is complete but your known case was the first check in >> the function you are "over" processing and will only add time to your sites load time. >> >> Thanks, >> Joseph Crawford >> >> On Mar 15, 2013, at 5:08 PM, David Mintz wrote: >> >>> function whatever(Array $array) { >>> >>> foreach ($array as $key => $value) { >>> if ($something) { >>> return true; >>> } >>> } >>> return false; >>> } >>> >>> Is there any reason -- style, legibility, whatever -- not to do the above? Or should you do something like >>> >>> function whatever(Array $array) { >>> >>> $return = false; >>> foreach ($array as $key => $value) { >>> if ($something) { >>> $return = true; >>> break; >>> } >>> } >>> return $return; >>> } >>> >>> Thanks. >>> >>> >>> -- >>> David Mintz >>> http://davidmintz.org/ >>> Fight for social equality: >>> http://socialequality.com/ >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show-participation >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From rstoll at tutteli.ch Fri Mar 15 21:11:57 2013 From: rstoll at tutteli.ch (Robert Stoll) Date: Sat, 16 Mar 2013 01:11:57 -0000 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach In-Reply-To: References: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> Message-ID: <003f01ce21e3$41cfbff0$c56f3fd0$@tutteli.ch> I would say the first version is ok but only because your function is small enough. If your function gets bigger and bigger, then it is better to have only one exit point in terms of readability. Von: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] Im Auftrag von Joseph Crawford Gesendet: Freitag, 15. M?rz 2013 22:15 An: NYPHP Talk Betreff: Re: [nycphp-talk] style question: returning from a function while you're in a foreach The only reason would be poorly designed code where the return value could change based on multiple separate conditionals. I have seen it in some legacy code. On Mar 15, 2013 5:50 PM, "Anthony Ferrara" wrote: > > The first is fine. There's no reason not to do it... > > > On Fri, Mar 15, 2013 at 5:30 PM, Joseph Crawford wrote: >> >> There are a few things to learn from here. >> >> First it is not only a styling thing. In the first one you have several return >> statements and in the second you only have 1 return statement. >> >> It will depend on the code logic but I tend to return when I have the value I need rather >> than assign it to a variable and have it continue to process through the rest of the function. >> >> If you only return after the entire function is complete but your known case was the first check in >> the function you are "over" processing and will only add time to your sites load time. >> >> Thanks, >> Joseph Crawford >> >> On Mar 15, 2013, at 5:08 PM, David Mintz wrote: >> >>> function whatever(Array $array) { >>> >>> foreach ($array as $key => $value) { >>> if ($something) { >>> return true; >>> } >>> } >>> return false; >>> } >>> >>> Is there any reason -- style, legibility, whatever -- not to do the above? Or should you do something like >>> >>> function whatever(Array $array) { >>> >>> $return = false; >>> foreach ($array as $key => $value) { >>> if ($something) { >>> $return = true; >>> break; >>> } >>> } >>> return $return; >>> } >>> >>> Thanks. >>> >>> >>> -- >>> David Mintz >>> http://davidmintz.org/ >>> Fight for social equality: >>> http://socialequality.com/ >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show-participation >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From codebowl at gmail.com Fri Mar 15 22:35:30 2013 From: codebowl at gmail.com (Joseph Crawford) Date: Fri, 15 Mar 2013 22:35:30 -0400 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach In-Reply-To: <003f01ce21e3$41cfbff0$c56f3fd0$@tutteli.ch> References: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> <003f01ce21e3$41cfbff0$c56f3fd0$@tutteli.ch> Message-ID: I personally would disagree with you on that one. I think the single return point is more confusing. Though that is more of a preference. The single return path leads to extra processing that would not be required. On Mar 15, 2013 9:12 PM, "Robert Stoll" wrote: > I would say the first version is ok but only because your function is > small enough.**** > > If your function gets bigger and bigger, then it is better to have only > one exit point in terms of readability.**** > > ** ** > > *Von:* talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > *Im Auftrag von *Joseph Crawford > *Gesendet:* Freitag, 15. M?rz 2013 22:15 > *An:* NYPHP Talk > *Betreff:* Re: [nycphp-talk] style question: returning from a function > while you're in a foreach**** > > ** ** > > The only reason would be poorly designed code where the return value could > change based on multiple separate conditionals. I have seen it in some > legacy code.**** > > On Mar 15, 2013 5:50 PM, "Anthony Ferrara" wrote: > > > > The first is fine. There's no reason not to do it... > > > > > > On Fri, Mar 15, 2013 at 5:30 PM, Joseph Crawford > wrote: > >> > >> There are a few things to learn from here. > >> > >> First it is not only a styling thing. In the first one you have > several return > >> statements and in the second you only have 1 return statement. > >> > >> It will depend on the code logic but I tend to return when I have the > value I need rather > >> than assign it to a variable and have it continue to process through > the rest of the function. > >> > >> If you only return after the entire function is complete but your known > case was the first check in > >> the function you are "over" processing and will only add time to your > sites load time. > >> > >> Thanks, > >> Joseph Crawford > >> > >> On Mar 15, 2013, at 5:08 PM, David Mintz wrote: > >> > >>> function whatever(Array $array) { > >>> > >>> foreach ($array as $key => $value) { > >>> if ($something) { > >>> return true; > >>> } > >>> } > >>> return false; > >>> } > >>> > >>> Is there any reason -- style, legibility, whatever -- not to do the > above? Or should you do something like > >>> > >>> function whatever(Array $array) { > >>> > >>> $return = false; > >>> foreach ($array as $key => $value) { > >>> if ($something) { > >>> $return = true; > >>> break; > >>> } > >>> } > >>> return $return; > >>> } > >>> > >>> Thanks. > >>> > >>> > >>> -- > >>> David Mintz > >>> http://davidmintz.org/ > >>> Fight for social equality: > >>> http://socialequality.com/ > >>> > >>> _______________________________________________ > >>> New York PHP User Group Community Talk Mailing List > >>> http://lists.nyphp.org/mailman/listinfo/talk > >>> > >>> http://www.nyphp.org/show-participation > >> > >> > >> > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show-participation > > > > > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show-participation**** > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rstoll at tutteli.ch Sat Mar 16 03:53:37 2013 From: rstoll at tutteli.ch (Robert Stoll) Date: Sat, 16 Mar 2013 07:53:37 -0000 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach In-Reply-To: References: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> <003f01ce21e3$41cfbff0$c56f3fd0$@tutteli.ch> Message-ID: <000601ce221b$5e6f7ff0$1b4e7fd0$@tutteli.ch> I agree, it is a personal preference and I also agree that is a little bit slower (but just a few microseconds) Von: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] Im Auftrag von Joseph Crawford Gesendet: Samstag, 16. M?rz 2013 02:36 An: NYPHP Talk Betreff: Re: [nycphp-talk] style question: returning from a function while you're in a foreach I personally would disagree with you on that one. I think the single return point is more confusing. Though that is more of a preference. The single return path leads to extra processing that would not be required. On Mar 15, 2013 9:12 PM, "Robert Stoll" wrote: I would say the first version is ok but only because your function is small enough. If your function gets bigger and bigger, then it is better to have only one exit point in terms of readability. Von: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] Im Auftrag von Joseph Crawford Gesendet: Freitag, 15. M?rz 2013 22:15 An: NYPHP Talk Betreff: Re: [nycphp-talk] style question: returning from a function while you're in a foreach The only reason would be poorly designed code where the return value could change based on multiple separate conditionals. I have seen it in some legacy code. On Mar 15, 2013 5:50 PM, "Anthony Ferrara" wrote: > > The first is fine. There's no reason not to do it... > > > On Fri, Mar 15, 2013 at 5:30 PM, Joseph Crawford wrote: >> >> There are a few things to learn from here. >> >> First it is not only a styling thing. In the first one you have several return >> statements and in the second you only have 1 return statement. >> >> It will depend on the code logic but I tend to return when I have the value I need rather >> than assign it to a variable and have it continue to process through the rest of the function. >> >> If you only return after the entire function is complete but your known case was the first check in >> the function you are "over" processing and will only add time to your sites load time. >> >> Thanks, >> Joseph Crawford >> >> On Mar 15, 2013, at 5:08 PM, David Mintz wrote: >> >>> function whatever(Array $array) { >>> >>> foreach ($array as $key => $value) { >>> if ($something) { >>> return true; >>> } >>> } >>> return false; >>> } >>> >>> Is there any reason -- style, legibility, whatever -- not to do the above? Or should you do something like >>> >>> function whatever(Array $array) { >>> >>> $return = false; >>> foreach ($array as $key => $value) { >>> if ($something) { >>> $return = true; >>> break; >>> } >>> } >>> return $return; >>> } >>> >>> Thanks. >>> >>> >>> -- >>> David Mintz >>> http://davidmintz.org/ >>> Fight for social equality: >>> http://socialequality.com/ >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show-participation >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show-participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainelemental at gmail.com Sat Mar 16 12:23:11 2013 From: rainelemental at gmail.com (Federico Ulfo) Date: Sat, 16 Mar 2013 12:23:11 -0400 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach In-Reply-To: References: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> <003f01ce21e3$41cfbff0$c56f3fd0$@tutteli.ch> Message-ID: +1 for the first, because -3 lines of code -1 variable, but really either are good. From bogus@does.not.exist.com Mon Mar 11 08:43:17 2013 From: bogus@does.not.exist.com () Date: Mon, 11 Mar 2013 12:43:17 -0000 Subject: No subject Message-ID: On Mar 15, 2013, at 10:35 PM, Joseph Crawford wrote: I personally would disagree with you on that one. I think the single return point is more confusing. Though that is more of a preference. The single return path leads to extra processing that would not be required= . On Mar 15, 2013 9:12 PM, "Robert Stoll" wrote: > I would say the first version is ok but only because your function is > small enough.**** > > If your function gets bigger and bigger, then it is better to have only > one exit point in terms of readability.**** > > ** ** > > *Von:* talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] > *Im Auftrag von *Joseph Crawford > *Gesendet:* Freitag, 15. M=E4rz 2013 22:15 > *An:* NYPHP Talk > *Betreff:* Re: [nycphp-talk] style question: returning from a function > while you're in a foreach**** > > ** ** > > The only reason would be poorly designed code where the return value coul= d > change based on multiple separate conditionals. I have seen it in some > legacy code.**** > > On Mar 15, 2013 5:50 PM, "Anthony Ferrara" wrote: > > > > The first is fine. There's no reason not to do it... > > > > > > On Fri, Mar 15, 2013 at 5:30 PM, Joseph Crawford > wrote: > >> > >> There are a few things to learn from here. > >> > >> First it is not only a styling thing. In the first one you have > several return > >> statements and in the second you only have 1 return statement. > >> > >> It will depend on the code logic but I tend to return when I have the > value I need rather > >> than assign it to a variable and have it continue to process through > the rest of the function. > >> > >> If you only return after the entire function is complete but your know= n > case was the first check in > >> the function you are "over" processing and will only add time to your > sites load time. > >> > >> Thanks, > >> Joseph Crawford > >> > >> On Mar 15, 2013, at 5:08 PM, David Mintz wrote: > >> > >>> function whatever(Array $array) { > >>> > >>> foreach ($array as $key =3D> $value) { > >>> if ($something) { > >>> return true; > >>> } > >>> } > >>> return false; > >>> } > >>> > >>> Is there any reason -- style, legibility, whatever -- not to do the > above? Or should you do something like > >>> > >>> function whatever(Array $array) { > >>> > >>> $return =3D false; > >>> foreach ($array as $key =3D> $value) { > >>> if ($something) { > >>> $return =3D true; > >>> break; > >>> } > >>> } > >>> return $return; > >>> } > >>> > >>> Thanks. > >>> > >>> > >>> -- > >>> David Mintz > >>> http://davidmintz.org/ > >>> Fight for social equality: > >>> http://socialequality.com/ > >>> > >>> _______________________________________________ > >>> New York PHP User Group Community Talk Mailing List > >>> http://lists.nyphp.org/mailman/listinfo/talk > >>> > >>> http://www.nyphp.org/show-participation > >> > >> > >> > >> _______________________________________________ > >> New York PHP User Group Community Talk Mailing List > >> http://lists.nyphp.org/mailman/listinfo/talk > >> > >> http://www.nyphp.org/show-participation > > > > > > > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show-participation**** > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show-participation --e89a8fb1f806d6361004d80d2d3d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
+1 for the first, because -3 = lines of code -1 variable, but really either are good.

=
From my iPhone

On Mar 15, 2013, at 10:35 PM, Joseph Craw= ford <codebowl at g= mail.com> wrote:

I personally would disagree wit= h you on that one.=A0 I think the single return point is more confusing.=A0= Though that is more of a preference.

The single return path leads to extra processing that would not be requi= red.

On Mar 15, 2013 9:12 PM, "Robert Stoll"= ; <rstoll at tutteli= .ch> wrote:

I would say the first version is ok but only because your= function is small enough.

If your function gets bigger and bigge= r, then it is better to have only one exit point=A0 in terms of readability= .

=A0

Von: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] Im Auftrag von Joseph Crawford
Gesendet: Freitag, 15. M=E4rz 2013 22:15
An: NYPHP TalkBetreff: Re: [nycphp-talk] style question: returning from a function= while you're in a foreach

=A0

The only reason would be poorly designed code where= the return value could change based on multiple separate conditionals.=A0 = I have seen it in some legacy code.

On Mar 15, 2013 5:5= 0 PM, "Anthony Ferrara" <ircmaxell at gmail.com> wrote:
>
> The first is fine. There's no reason not to do it...
&g= t;
>
> On Fri, Mar 15, 2013 at 5:30 PM, Joseph Crawford <codebowl at gmail.com= > wrote:
>>
>> There are a few things to learn from here.
>>=
>> First it is not only a styling thing. =A0In the first one you = have several return
>> statements and in the second you only have = 1 return statement.
>>
>> It will depend on the code logic but I tend to return = when I have the value I need rather=A0
>> than assign it to a vari= able and have it continue to process through the rest of the function.
>>
>> If you only return after the entire function is comple= te but your known case was the first check in
>> the function you = are "over" processing and will only add time to your sites load t= ime.
>>
>> Thanks,
>> Joseph Crawford
>>
>= ;> On Mar 15, 2013, at 5:08 PM, David Mintz wrote:
>>
>&g= t;> function whatever(Array $array) {
>>>
>>> = =A0 =A0 foreach ($array as $key =3D> $value) {
>>> =A0 =A0 =A0 =A0 if =A0($something) =A0{
>>> =A0 = =A0 =A0 =A0 =A0 =A0 =A0return true;
>>> =A0 =A0 =A0 =A0 }
&g= t;>> =A0 =A0 }
>>> =A0 =A0 return false;
>>> = }
>>>
>>> Is there any reason =A0-- style, legibili= ty, whatever -- not to do the above? Or should you do something like
>>>
>>> function whatever(Array $array) =A0{
>&g= t;>
>>> =A0 =A0$return =3D false;
>>> =A0 =A0 fo= reach ($array as $key =3D> $value) {
>>> =A0 =A0 =A0 =A0 if = =A0($something) =A0{
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0$return =3D true;
>>> = =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
>>> =A0 =A0 =A0 =A0 }
>= >> =A0 =A0 }
>>> =A0 =A0 return $return;
>>> = }
>>>
>>> Thanks.
>>>
>>>
>>> --
>>> David Mint= z
>>> http= ://davidmintz.org/
>>> Fight for social equality:
>&g= t;> http://soci= alequality.com/
>>>
>>> ______________________________________________= _
>>> New York PHP User Group Community Talk Mailing List
&g= t;>> http://lists.nyphp.org/mailman/listinfo/talk
>>>
>>> http://www.nyphp.org/show-participation
>= >
>>
>>
>> __________________________________= _____________
>> New York PHP User Group Community Talk Mailing List
>> ht= tp://lists.nyphp.org/mailman/listinfo/talk
>>
>> http://ww= w.nyphp.org/show-participation
>
>
>
> ______________________________________________= _
> New York PHP User Group Community Talk Mailing List
> http:= //lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/show-participation

=

_______________________________________________
New York PHP User Group Community Talk Mailing List
= http://lists.nyphp.org/mailman/listinfo/talk

http:= //www.nyphp.org/show-participation
___________________= ____________________________
New York PHP User Group Commun= ity Talk Mailing List
http://lists.nyphp.org/mailman/listin= fo/talk

http://www.nyphp.org/show-participation
<= /blockquote>
--e89a8fb1f806d6361004d80d2d3d-- From nhart at partsauthority.com Tue Mar 19 14:58:26 2013 From: nhart at partsauthority.com (Nicholas Hart) Date: Tue, 19 Mar 2013 14:58:26 -0400 Subject: [nycphp-talk] Creating Barcodes.. Message-ID: I need to generate a barcode in php and link it to an html document for printing and then scanning. Has anyone done this? I have been attempting this using the Free30f9.TTF font but I was unable to get this to scan at all. I have also tried barcode command in linux which does scan but only outputs to ps or pcl. In short, not having much luck. If anyone has any suggestions, please send along. I don't want to have to pay for a barcode package as this shouldn't be all that difficult, right? Thanks, Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: From dorgan at donaldorgan.com Tue Mar 19 15:04:49 2013 From: dorgan at donaldorgan.com (Donald Organ) Date: Tue, 19 Mar 2013 15:04:49 -0400 Subject: [nycphp-talk] Creating Barcodes.. In-Reply-To: References: Message-ID: take a look at the command line utility called ps2raster you can specify the output format. On Tue, Mar 19, 2013 at 2:58 PM, Nicholas Hart wrote: > I need to generate a barcode in php and link it to an html document for > printing and then scanning. Has anyone done this? I have been attempting > this using the Free30f9.TTF font but I was unable to get this to scan at > all. I have also tried barcode command in linux which does scan but only > outputs to ps or pcl. In short, not having much luck. If anyone has any > suggestions, please send along. I don't want to have to pay for a barcode > package as this shouldn't be all that difficult, right? > > Thanks, > Nick > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at davidmintz.org Wed Mar 20 10:15:41 2013 From: david at davidmintz.org (David Mintz) Date: Wed, 20 Mar 2013 10:15:41 -0400 Subject: [nycphp-talk] style question: returning from a function while you're in a foreach In-Reply-To: References: <13CDEF5D-0050-4F45-87AD-F7BBC6A69EF3@gmail.com> <003f01ce21e3$41cfbff0$c56f3fd0$@tutteli.ch> Message-ID: Just wanna say thanks for the comments. I've since realized from looking at the Zend Framework, which aspires to high standards, that they certainly do use the return-as-soon-as-you-figure-it-out approach in method definitions that are pretty short, and it's extremely clear reading. If we look closer we'll probably find that they have the most likely ifs before the less likely. So I'd say this approach is optimal from every point of view. On Sat, Mar 16, 2013 at 12:23 PM, Federico Ulfo wrote: > +1 for the first, because -3 lines of code -1 variable, but really either > are good. > > > -- David Mintz http://davidmintz.org/ Fight for social equality: http://socialequality.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From zaunere at gmail.com Wed Mar 20 14:23:41 2013 From: zaunere at gmail.com (Hans Z) Date: Wed, 20 Mar 2013 14:23:41 -0400 Subject: [nycphp-talk] MODX Meetup in NJ & Lena In-Reply-To: References: Message-ID: > Hans and Daniel, I would be happy to give a presentation on MODX to the > group, if it has been a while since one was delivered. We are using MODX > for a broad spectrum of projects for start-ups through Fortune 500 > companies. Sorry, lost in the endless inbox of gmail... I think this is good - the March meeting is probably too close - how about April? And as an aside... we're putting into works a PHP conference and first steps is finding a venue - 100+ if possible - suggestions appreciated! H From rainelemental at gmail.com Wed Mar 20 15:23:26 2013 From: rainelemental at gmail.com (Rainelemental) Date: Wed, 20 Mar 2013 15:23:26 -0400 Subject: [nycphp-talk] MODX Meetup in NJ & Lena In-Reply-To: References: Message-ID: <9A811843-C585-42FE-936C-A81DA9FB2E62@gmail.com> Awesome Hans!!! From my iPhone On Mar 20, 2013, at 2:23 PM, Hans Z wrote: >> Hans and Daniel, I would be happy to give a presentation on MODX to the >> group, if it has been a while since one was delivered. We are using MODX >> for a broad spectrum of projects for start-ups through Fortune 500 >> companies. > > Sorry, lost in the endless inbox of gmail... > > I think this is good - the March meeting is probably too close - how > about April? > > And as an aside... we're putting into works a PHP conference and first > steps is finding a venue - 100+ if possible - suggestions appreciated! > > H > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation From hans at cyberxdesigns.com Wed Mar 20 17:12:35 2013 From: hans at cyberxdesigns.com (Hans C. Kaspersetz) Date: Wed, 20 Mar 2013 17:12:35 -0400 Subject: [nycphp-talk] MODX Meetup in NJ & Lena In-Reply-To: References: Message-ID: <47AE52D7-3241-49CA-A068-2A3CC244CEE8@cyberxdesigns.com> The Jewish museum downtown was good. I just sponsored the Lean Day UX conference there. What date is july's meeting? I will be at TedMed in DC in the middle of the month. Hans Kaspersetz Cyber X Designs 201-558-7929 hans at cyberxdesigns.com http://cyberxdesigns.com Sent from my tricorder On Mar 20, 2013, at 2:23 PM, Hans Z wrote: >> Hans and Daniel, I would be happy to give a presentation on MODX to the >> group, if it has been a while since one was delivered. We are using MODX >> for a broad spectrum of projects for start-ups through Fortune 500 >> companies. > > Sorry, lost in the endless inbox of gmail... > > I think this is good - the March meeting is probably too close - how > about April? > > And as an aside... we're putting into works a PHP conference and first > steps is finding a venue - 100+ if possible - suggestions appreciated! > > H > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation From rainelemental at gmail.com Fri Mar 29 19:14:45 2013 From: rainelemental at gmail.com (Federico Ulfo) Date: Fri, 29 Mar 2013 19:14:45 -0400 Subject: [nycphp-talk] litespeed server Message-ID: Hi, have you guys tried LiteSpeed server with PHP? I'm interested to hear your experience. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From ircmaxell at gmail.com Fri Mar 29 19:36:20 2013 From: ircmaxell at gmail.com (Anthony Ferrara) Date: Fri, 29 Mar 2013 19:36:20 -0400 Subject: [nycphp-talk] litespeed server In-Reply-To: References: Message-ID: This comes up every few years. The dies off. Its not worth it. Stick with nginx and php-fpm and be done with it. Anthony. On Mar 29, 2013 7:15 PM, "Federico Ulfo" wrote: > Hi, have you guys tried LiteSpeed server with PHP? I'm interested to hear > your experience. > Thanks > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainelemental at gmail.com Fri Mar 29 19:47:54 2013 From: rainelemental at gmail.com (Federico Ulfo) Date: Fri, 29 Mar 2013 19:47:54 -0400 Subject: [nycphp-talk] litespeed server In-Reply-To: References: Message-ID: So we'll stick on ngnix + phpfpm, but now I'm questioning the hosting we're moving to (vps.net), because is their tech support that suggested litespeed for a WP website. I start to be skeptical every time I read "X time faster then A" or "all the cool kids are using it". Thanks On Fri, Mar 29, 2013 at 7:36 PM, Anthony Ferrara wrote: > This comes up every few years. The dies off. Its not worth it. Stick with > nginx and php-fpm and be done with it. > > Anthony. > On Mar 29, 2013 7:15 PM, "Federico Ulfo" wrote: > >> Hi, have you guys tried LiteSpeed server with PHP? I'm interested to hear >> your experience. >> Thanks >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation >> > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmarscher at beaffinitive.com Sat Mar 30 10:23:13 2013 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Sat, 30 Mar 2013 10:23:13 -0400 Subject: [nycphp-talk] litespeed server In-Reply-To: References: Message-ID: I've used Litespeed a bunch in production. It works well, but there is a learning curve to use it properly. For example, in the lsphp External App in the Server config section, I had to add these environment vars to it to get it to use one instance for APC: LSAPI_CHILDREN=100 LSAPI_AVOID_FORK=1 LSAPI_SLOW_REQ_MSECS=30000 LSAPI_ACCEPT_NOTIFY=1 But I've moved on to nginx/php-fpm for new servers. I used Litespeed before that combo was available. If the vps.net tech support is going to setup and manage it for you, then maybe go with Litespeed if they are most comfortable with that. Otherwise, go with what you know best. On Fri, Mar 29, 2013 at 7:47 PM, Federico Ulfo wrote: > So we'll stick on ngnix + phpfpm, but now I'm questioning the hosting > we're moving to (vps.net), because is their tech support that suggested > litespeed for a WP website. I start to be skeptical every time I read "X > time faster then A" or "all the cool kids are using it". > Thanks > > > On Fri, Mar 29, 2013 at 7:36 PM, Anthony Ferrara wrote: > >> This comes up every few years. The dies off. Its not worth it. Stick with >> nginx and php-fpm and be done with it. >> >> Anthony. >> On Mar 29, 2013 7:15 PM, "Federico Ulfo" wrote: >> >>> Hi, have you guys tried LiteSpeed server with PHP? I'm interested to >>> hear your experience. >>> Thanks >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show-participation >>> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation >> > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainelemental at gmail.com Sat Mar 30 11:40:58 2013 From: rainelemental at gmail.com (Federico Ulfo) Date: Sat, 30 Mar 2013 11:40:58 -0400 Subject: [nycphp-talk] litespeed server In-Reply-To: References: Message-ID: Errata corrige: it wans't vps.net support that suggested litespeed, but an unrelated blog post. We'll go for nginx php-fpm. Thanks guys. -------------- next part -------------- An HTML attachment was scrubbed... URL: