Re: Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Tommy Pham
On Tue, Feb 7, 2012 at 2:31 PM, Paul M Foster wrote: > On Tue, Feb 07, 2012 at 09:02:00PM +, Tim Streater wrote: > >> On 07 Feb 2012 at 19:34, Daniel Brown wrote: >> >> > On Tue, Feb 7, 2012 at 13:56, Mike Mackintosh >> > wrote: >> >> I was curious to see what everyones favorite design patte

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ghodmode
On Wed, Feb 8, 2012 at 4:10 AM, Ashley Sheridan wrote: > On Tue, 2012-02-07 at 11:50 -0800, Micky Hulse wrote: > >> Was there ever a time when having a comma at the end of the last array >> element was not acceptable in PHP? ... > It's fine in PHP, and some coding practices actually encourage it,

RES: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Alejandro Michelin Salomon
Mike: My favorite are singleton ( database connection configuration ), and factory. Factory i use when need one code exporting or doing different process. Basically y have a base class with general code and a specific class that extend the base class with code specific to the process to be made

Re: Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Paul M Foster
On Tue, Feb 07, 2012 at 09:02:00PM +, Tim Streater wrote: > On 07 Feb 2012 at 19:34, Daniel Brown wrote: > > > On Tue, Feb 7, 2012 at 13:56, Mike Mackintosh > > wrote: > >> I was curious to see what everyones favorite design patterns were, if you > >> use > >> any, and why/when have you u

Re: Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Tim Streater
On 07 Feb 2012 at 19:34, Daniel Brown wrote: > On Tue, Feb 7, 2012 at 13:56, Mike Mackintosh > wrote: >> I was curious to see what everyones favorite design patterns were, if you use >> any, and why/when have you used it? >> >> Choices include slots and signals (observer), singleton, mvc, hmvc,

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:32 PM, Ashley Sheridan wrote: > That's because it's not an array you've got the trailing delimiter on, it's a > string. Right. Sorry, bad example. it was just the one example I could think of where you could get an empty element at the end of your array. Clearly, appl

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ashley Sheridan
On Tue, 2012-02-07 at 12:26 -0800, Micky Hulse wrote: > On Tue, Feb 7, 2012 at 12:19 PM, Micky Hulse wrote: > > Yah, ditto! :D > > $s = 'foo,bar,'; > print_r(explode(',', $s)); > > The output is: > > Array > ( > [0] => foo > [1] => bar > [2] => > ) > > That's one instance where I

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Robert Williams
On 2/7/12 13:15, "Paul M Foster" wrote: >I've always avoided trailing array commas, but only because I was under >the impression that leaving one there would append a blank array member >to the array, where it might be problematic. Yes? No? Nope. In fact, it's officially supported syntax:

Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Bastien
On 2012-02-07, at 2:34 PM, Daniel Brown wrote: > On Tue, Feb 7, 2012 at 13:56, Mike Mackintosh > wrote: >> I was curious to see what everyones favorite design patterns were, if you >> use any, and why/when have you used it? >> >> Choices include slots and signals (observer), singleton, mvc, h

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:19 PM, Micky Hulse wrote: > Yah, ditto! :D $s = 'foo,bar,'; print_r(explode(',', $s)); The output is: Array ( [0] => foo [1] => bar [2] => ) That's one instance where I know you have to be cautious about the trailing delimiter. I know, this is all noob st

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
On Tue, Feb 7, 2012 at 12:15 PM, Paul M Foster wrote: > I've always avoided trailing array commas, but only because I was under > the impression that leaving one there would append a blank array member > to the array, where it might be problematic. Yes? No? Yah, ditto! :D In my few simple tests,

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ashley Sheridan
On Tue, 2012-02-07 at 15:15 -0500, Paul M Foster wrote: > On Tue, Feb 07, 2012 at 11:50:45AM -0800, Micky Hulse wrote: > > > Was there ever a time when having a comma at the end of the last array > > element was not acceptable in PHP? > > > > I just did a few quick tests: > > > >

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
Hi Ashley! Thanks for your quick and informative reply, I really appreciate it. :) On Tue, Feb 7, 2012 at 12:10 PM, Ashley Sheridan wrote: > It's easy to add and remove elements without making sure you have to check > the trailing comma. It's also OK in Javascript to use the trailing comma, as

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Paul M Foster
On Tue, Feb 07, 2012 at 11:50:45AM -0800, Micky Hulse wrote: > Was there ever a time when having a comma at the end of the last array > element was not acceptable in PHP? > > I just did a few quick tests: > > > > ... and it looks like having that comma ain't no

Re: [PHP] Arrays: Comma at end?

2012-02-07 Thread Ashley Sheridan
On Tue, 2012-02-07 at 11:50 -0800, Micky Hulse wrote: > Was there ever a time when having a comma at the end of the last array > element was not acceptable in PHP? > > I just did a few quick tests: > > > > ... and it looks like having that comma ain't no big de

[PHP] Arrays: Comma at end?

2012-02-07 Thread Micky Hulse
Was there ever a time when having a comma at the end of the last array element was not acceptable in PHP? I just did a few quick tests: ... and it looks like having that comma ain't no big deal. I can't believe that I always thought that having the trailing com

Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Daniel Brown
On Tue, Feb 7, 2012 at 13:56, Mike Mackintosh wrote: > I was curious to see what everyones favorite design patterns were, if you use > any, and why/when have you used it? > > Choices include slots and signals (observer), singleton, mvc, hmvc, factory, > commander etc.. Mine is apparently CP

Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Fatih P.
mostly MVC, Singleton and Factory. depends on requirements.

Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Adam Richardson
On Tue, Feb 7, 2012 at 1:56 PM, Mike Mackintosh < mike.mackint...@angrystatic.com> wrote: > I was curious to see what everyones favorite design patterns were, if you > use any, and why/when have you used it? > > Choices include slots and signals (observer), singleton, mvc, hmvc, > factory, command

RE: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread admin
> -Original Message- > From: Mike Mackintosh [mailto:mike.mackint...@angrystatic.com] > Sent: Tuesday, February 07, 2012 1:57 PM > To: PHP General List > Subject: [PHP] What's Your Favorite Design Pattern? > > I was curious to see what everyones favorite design patterns were, if > you use

Re: [PHP] How to detect languages from (=> LTR vs RTL)

2012-02-07 Thread Dotan Cohen
On Tue, Feb 7, 2012 at 19:31, Dotan Cohen wrote: > function is_strong($char) { >    if (  in_array($char, $arrayOfRtlCharacters)  ) { >        return "RTL"; >    } >    if (  in_array($char, $arrayOfLtrCharacters)  ) { >        return "LTR"; >    } >    return FALSE; > } > On second thought, you

Re: [PHP] How to detect languages from (=> LTR vs RTL)

2012-02-07 Thread Dotan Cohen
On Tue, Feb 7, 2012 at 10:37, Michelle Konzack wrote: > Hi colleges and gurus, > > I coding a whole "web office" and one of my problems is "LTR vs RTL". > If I have for exanple an E-Mail I use a > >     >      $SOME_TEXT >     > > but HOW can I detect the type of $SOME_TEXT  from  within  PHP,  to

Re: [PHP] Long Live GOTO

2012-02-07 Thread Tedd Sperling
On Feb 6, 2012, at 11:28 AM, Larry Martell wrote: > Just for another data point, the FAA does not allow gotos in any code > that goes into an airplane. That settles it -- the government knows best. Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing

Re: [PHP] Headers on smart phone browsers

2012-02-07 Thread Tedd Sperling
On Feb 6, 2012, at 4:01 PM, Stuart Dallas wrote: > Generally speaking you're better off with a design that automatically adapts > to the viewport on which it's being displayed. While there's more than one > reason for this, the overriding reason is that the same software (i.e. the > same user ag

RE: [PHP] syntax question

2012-02-07 Thread admin
> -Original Message- > From: ma...@behnke.biz [mailto:ma...@behnke.biz] > Sent: Tuesday, February 07, 2012 10:47 AM > To: php-general@lists.php.net; ad...@buskirkgraphics.com > Subject: Re: [PHP] syntax question > > > > ad...@buskirkgraphics.com hat am 7. Februar 2012 um 15:11 geschrieb

Re: [PHP] syntax question

2012-02-07 Thread ma...@behnke.biz
ad...@buskirkgraphics.com hat am 7. Februar 2012 um 15:11 geschrieben: > I have been struggling with this issue for an hour and honestly I am not > sure why. > > I consider myself to be pretty savvy with MySQL but I am running into an > syntax error that is just flat out eluding me. > > > > $qu

Re: [PHP] Headers on smart phone browsers

2012-02-07 Thread Marc Guay
> There is only one drawback to using CSS media queries to alter the way a > page is displayed on different resolutions, and that is that any media > (i.e. background images, etc) referenced in a stylesheet is downloaded, > regardless of if it is ever used. Another one worth mentionning is that a

RE: [PHP] syntax question

2012-02-07 Thread admin
> -Original Message- > From: Louis Huppenbauer [mailto:louis.huppenba...@gmail.com] > Sent: Tuesday, February 07, 2012 9:24 AM > To: ad...@buskirkgraphics.com > Cc: php-general@lists.php.net > Subject: Re: [PHP] syntax question > > Generally... Wouldn't grouping by an id (which is normall

Re: [PHP] syntax question

2012-02-07 Thread Louis Huppenbauer
Generally... Wouldn't grouping by an id (which is normally unique) have no real benefit... Except some strange behaviour? Just to clarify: Why aren't you sticking to the LIMIT 1? 2012/2/7 > I have been struggling with this issue for an hour and honestly I am not > sure why. > > I consider mysel

[PHP] syntax question

2012-02-07 Thread admin
I have been struggling with this issue for an hour and honestly I am not sure why. I consider myself to be pretty savvy with MySQL but I am running into an syntax error that is just flat out eluding me. $query = "SELECT `table2`.`name` from `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.

Re: [PHP] Re: How can I debug wsf/php in eclipse?

2012-02-07 Thread Ali Asghar Toraby Parizy
:( Thanks for your help. Is it the only way? On Tue, Feb 7, 2012 at 12:44 PM, Sharl.Jimh.Tsin wrote: > 在 2012-02-07二的 12:11 +0330,Ali Asghar Toraby Parizy写道: > > Can anybody help me in this regard? > > > > On Mon, Feb 6, 2012 at 10:15 PM, Ali Asghar Toraby Parizy < > > aliasghar.tor...@gmail.com>

Re: [PHP] How to detect languages from (=> LTR vs RTL)

2012-02-07 Thread Ashley Sheridan
On Tue, 2012-02-07 at 09:37 +0100, Michelle Konzack wrote: > Hi colleges and gurus, > > I coding a whole "web office" and one of my problems is "LTR vs RTL". > If I have for exanple an E-Mail I use a > > > $SOME_TEXT > > > but HOW can I detect the type of $SOME_TEXT from withi

Re: [PHP] Headers on smart phone browsers

2012-02-07 Thread Ashley Sheridan
On Mon, 2012-02-06 at 18:09 -0600, Donovan Brooke wrote: > Mari Masuda wrote: > [snip] > > For a concrete example of responsive design in action, point your browser > > to http://www.sasquatchfestival.com/ and then slowly make the window > > wider/skinnier to see how the design adapts to differe

Re: [PHP] Re: How can I debug wsf/php in eclipse?

2012-02-07 Thread Sharl.Jimh.Tsin
在 2012-02-07二的 12:11 +0330,Ali Asghar Toraby Parizy写道: > Can anybody help me in this regard? > > On Mon, Feb 6, 2012 at 10:15 PM, Ali Asghar Toraby Parizy < > aliasghar.tor...@gmail.com> wrote: > > > Hi. > > I'm developing a wsf/php web service. I'm using doc/lit messaging format > > and every th

[PHP] Re: How can I debug wsf/php in eclipse?

2012-02-07 Thread Ali Asghar Toraby Parizy
Can anybody help me in this regard? On Mon, Feb 6, 2012 at 10:15 PM, Ali Asghar Toraby Parizy < aliasghar.tor...@gmail.com> wrote: > Hi. > I'm developing a wsf/php web service. I'm using doc/lit messaging format > and every thing is OK. > But I don't know how i can debug my web services using ecl

[PHP] How to detect languages from (=> LTR vs RTL)

2012-02-07 Thread Michelle Konzack
Hi colleges and gurus, I coding a whole "web office" and one of my problems is "LTR vs RTL". If I have for exanple an E-Mail I use a $SOME_TEXT but HOW can I detect the type of $SOME_TEXT from within PHP, to set $DIRECTION? (RTL or LTR) correctly? And how can I do this with