php-general Digest 1 Jan 2010 07:08:01 -0000 Issue 6516

Topics (messages 300756 through 300770):

Re: Happy New Year All!
        300756 by: Bipper Goes!
        300757 by: Paul Scott
        300759 by: Robert Cummings
        300760 by: Bipper Goes!
        300761 by: Robert Cummings
        300762 by: Paul Scott

Happy New Year
        300758 by: tedd
        300763 by: James Colannino
        300764 by: Sudheer Satyanarayana
        300765 by: Carlos Medina
        300766 by: Bastien Koert
        300767 by: Richard
        300768 by: Bipper Goes!

Re: If design patterns are not supposed to produce reusable code then why use 
them?
        300769 by: Larry Garfield

PHP uploaded files logs
        300770 by: Manoj Singh

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
return ThankYou;


Oh god I think I blowed it up.

:)

-Bip

On Thu, Dec 31, 2009 at 1:11 AM, paragasu <parag...@gmail.com> wrote:

> <?php
>
> /** this going to be a long wish from Malaysia
>  *  @author paragasu
>  */
>
> do { echo 'wish you .. \n'; } (date('Y') < 2010) ;
> exit (' Happy New Year');
>
>
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Bipper Goes! wrote:
> return ThankYou;
> 
> 
> Oh god I think I blowed it up.

I prefer:

<?php
while(date('Y') < 2010) ;
exit (' Happy New Year');


-- 
-- Paul

http://www.paulscott.za.net
http://twitter.com/paulscott56
http://avoir.uwc.ac.za
All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal

--- End Message ---
--- Begin Message ---


Paul Scott wrote:
Bipper Goes! wrote:
return ThankYou;


Oh god I think I blowed it up.

I prefer:

<?php
while(date('Y') < 2010) ;
exit (' Happy New Year');


Oh dear... that's terribly inefficient... Here's a better stab:

<?php

sleep( strtotime( '2009-12-31 23:59:50' ) - time() );
for( $i = 10; $i >= 0; $i-- )
{
    echo $i ? "$i...\n" : "HAPPY NEW YEAR!\n";
    sleep( 1 );
}

?>

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

--- End Message ---
--- Begin Message ---
On Thu, Dec 31, 2009 at 10:52 AM, Robert Cummings <rob...@interjinn.com>wrote:

>
>
> Paul Scott wrote:
>
>> Bipper Goes! wrote:
>>
>>> return ThankYou;
>>>
>>>
>>> Oh god I think I blowed it up.
>>>
>>
>> I prefer:
>>
>> <?php
>> while(date('Y') < 2010) ;
>> exit (' Happy New Year');
>>
>
>
> Oh dear... that's terribly inefficient... Here's a better stab:
>
> <?php
>
> sleep( strtotime( '2009-12-31 23:59:50' ) - time() );
> for( $i = 10; $i >= 0; $i-- )
> {
>    echo $i ? "$i...\n" : "HAPPY NEW YEAR!\n";
>    sleep( 1 );
> }
>
> ?>
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>

Efficiency, to me, was getting the email out in 15 seconds or less.  ;)

--- End Message ---
--- Begin Message ---
Bipper Goes! wrote:
On Thu, Dec 31, 2009 at 10:52 AM, Robert Cummings <rob...@interjinn.com>wrote:


Paul Scott wrote:

Bipper Goes! wrote:

return ThankYou;


Oh god I think I blowed it up.

I prefer:

<?php
while(date('Y') < 2010) ;
exit (' Happy New Year');


Oh dear... that's terribly inefficient... Here's a better stab:

<?php

sleep( strtotime( '2009-12-31 23:59:50' ) - time() );
for( $i = 10; $i >= 0; $i-- )
{
   echo $i ? "$i...\n" : "HAPPY NEW YEAR!\n";
   sleep( 1 );
}

?>

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


Efficiency, to me, was getting the email out in 15 seconds or less.  ;)

Indeed you did nail that one on the head :D





--- End Message ---
--- Begin Message ---
------=neXtPaRt_1262280971
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit


Robert Cummings wrote:
> 
> Oh dear... that's terribly inefficient... Here's a better stab:

True, but my design criteria included that it needed to fit into a 140
char tweet too...

-- 
-- Paul

http://www.paulscott.za.net
http://twitter.com/paulscott56
http://avoir.uwc.ac.za

------=neXtPaRt_1262280971
Content-Type: text/plain;

All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal

--- End Message ---
--- Begin Message ---
Hi gang:

Happy New Year!

May 2010 > 2009.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
tedd wrote:

> May 2010 > 2009.

Fortunately, I think that's automatically true by definition :-D

James


--- End Message ---
--- Begin Message ---

May 2010>  2009.
Fortunately, I think that's automatically true by definition :-D

James
Humorous.


--

With warm regards,
Sudheer. S
Tech stuff: http://techchorus.net
Business: http://binaryvibes.co.in


--- End Message ---
--- Begin Message ---
tedd schrieb:
Hi gang:

Happy New Year!

May 2010 > 2009.

Cheers,

tedd

Happy new Year,
i wish you exited works, exited drinks, exited chicks and course exited code :-D

Carlos

--- End Message ---
--- Begin Message ---
On Thu, Dec 31, 2009 at 1:20 PM, Carlos Medina <i...@simply-networks.de> wrote:
> tedd schrieb:
>>
>> Hi gang:
>>
>> Happy New Year!
>>
>> May 2010 > 2009.
>>
>> Cheers,
>>
>> tedd
>>
> Happy new Year,
> i wish you exited works, exited drinks, exited chicks and course exited code
> :-D
>
> Carlos

As long as we all don't exit prematurely. ;-P


-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
Hi,

> exited works

Eh? Excited?

-- 
Richard Heyes
HTML5 canvas graphing: RGraph - www.rgraph.net (updated 19th December
- now with IE support!)
Lots of PHP and Javascript code - http://www.phpguru.org

--- End Message ---
--- Begin Message ---
"As long as we all don't exit prematurely. ;-P"

They always hate that.

On Thu, Dec 31, 2009 at 12:29 PM, Bastien Koert <phps...@gmail.com> wrote:

> On Thu, Dec 31, 2009 at 1:20 PM, Carlos Medina <i...@simply-networks.de>
> wrote:
> > tedd schrieb:
> >>
> >> Hi gang:
> >>
> >> Happy New Year!
> >>
> >> May 2010 > 2009.
> >>
> >> Cheers,
> >>
> >> tedd
> >>
> > Happy new Year,
> > i wish you exited works, exited drinks, exited chicks and course exited
> code
> > :-D
> >
> > Carlos
>
> As long as we all don't exit prematurely. ;-P
>
>
> --
>
> Bastien
>
> Cat, the other other white meat
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Meant to send this to the list, sorry.

----------  Forwarded Message  ----------

Subject: Re: [PHP] If design patterns are not supposed to produce reusable 
code then why use them?
Date: Thursday 31 December 2009
From: Larry Garfield <la...@garfieldtech.com>
To: "Tony Marston" <t...@marston-home.demon.co.uk>

On Wednesday 30 December 2009 10:50:40 am Tony Marston wrote:
> I have recently been engaged in an argument via email with someone who
> criticises my low opinion of design patterns (refer to
> http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that
> design patterns are merely a convention and not a reusable component. My
> argument is that something called a pattern is supposed to have a recurring
> theme, some element of reusability, so that all subsequent implementations
> of a pattern should require less effort than the first implementation. If
> design patterns do not provide any reusable code then what is the point of
> using them?
> 
> 
> 
> I do not use design patterns as I consider them to be the wrong level of
> abstraction. I am in the business of designing and developing entire
> applications which comprise of numerous application transactions, so I much
> prefer to use transaction patterns (refer to
> http://www.tonymarston.net/php-mysql/design-patterns-are-dead.html and
> http://www.tonymarston.net/php-mysql/transaction-patterns.html ) as these
> provide large amounts of reusable code and are therefore a significant aid
> to programmer productivity.
> 
> 
> 
> What is your opinion? Are design patterns supposed to provide reusable code
> or not? If not, and each implementation of a pattern takes just as much
>  time as the first, then where are the productivity gains from using design
>  patterns?

It depends what you're reusing.  Design patterns are reusable concepts, not 
reusable code.  That's the key difference.

Knowledge of design patterns is like knowledge of how different food 
ingredients interact.  "Hm, this needs something to bring out the taste more, 
so I'll add salt."  You're not going to add the same salt to each dish, 
obviously, but the idea is that you need something that will bring out the 
taste, and there are certain spices that will bring out the existing taste of 
whatever it is you put them on, such as salt.  

Similarly, if you want, say, a piece of code that will connect to a database, 
you want a pre-built library, not a design pattern.  (There's no shortage of 
those.)  If, however, you want a mechanism by which you can have different 
implementations of the same system, and want to swap them out without 
rewriting the calling code, then what you want is the factory *pattern*.  
There may not be existing code yet for whatever system you're writing.  
However, once you recognize "Ah, I want a common interface with a swappable 
implementation, and I want to pick the implementation at runtime based on some 
arbitrarily complex logic", then you know you don't need to think through how 
you go about structuring the code to do that.  Instead, you look up a 
description of the factory pattern and go "ah, that makes sense, and it solves 
3 problems that I didn't realize I'd run into later".  Then you go and 
implement code that follows that pattern, and you don't have to think through 
the algorithm.

Now, it is possible to make generic implementations of some patterns that you 
can re-leverage.  Eg, you can have a common factory interface and a way to 
request a factory, which in turn will give you the implementation object you 
want.  The common elements of those factories you move up to a parent class, 
and therefore reuse code that way.  This is known as a "Factory factory", and 
is in some cases very useful and in others gross over-engineering.  Knowing 
which is which is something you learn through experience.

--Larry Garfield

-------------------------------------------------------

--- End Message ---
--- Begin Message ---
Hi,

Is PHP maintaining the logs regarding files uploaded? Actually I needed it
because recently in my developed web site upload functionality seems to stop
working even for the correct file and i want to check that which type of
files are uploaded. Actually I cannot debug through PHP on the server as my
site is on production.

Please help me out.

Regards,
Manoj

--- End Message ---

Reply via email to