php-general Digest 5 Jan 2010 01:22:49 -0000 Issue 6521

2010-01-04 Thread php-general-digest-help

php-general Digest 5 Jan 2010 01:22:49 - Issue 6521

Topics (messages 300792 through 300799):

Re: strtotime - assumptions about default formatting of dates
300792 by: Pete Ford

Re: If design patterns are not supposed to produce reusable code then why use 
them?
300793 by: Richard Quadling
300794 by: Robert Cummings

Intermittent etwork connection errors with apache.  Restarting apache 
temporarily fixes the problem.  PHP or apache problem?
300795 by: Mark London
300797 by: Andy Shellam

Streaming OGG/MP3
300796 by: Parham Doustdar

Howto Install XAMPP XDebug Netbeans
300798 by: German Geek

What is the difference between the two streams 5.3 and 5.2 versions and What is 
the need for maintaining two streams?
300799 by: Varuna Seneviratna

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 ---

On 24/12/09 16:59, Bastien Koert wrote:

On Thu, Dec 24, 2009 at 9:12 AM, tedd  wrote:

At 10:20 PM +1000 12/24/09, Angus Mann wrote:


Hi all. I need to allow users to enter dates and times, and for a while
now I've been forcing them to use javascript date/time pickers so I can be
absolutely sure the formatting is correct.

Some users are requesting to be able to type the entries themselves so
I've decided to allow this.

I'm in Australia, and the standard formatting of dates here is DD/MM/
or DD-MM-

I recognize this is different to what seems to happen in the US, where it
is MM/DD/ or MM-DD-

When I process an entered date using strtotime() it seems to work fine.

But of course I am concerned when dates like January 2 come up.

I find that 2/1/2009 is interpreted as January 2, 2009 on my installation,
which is Windows 7 with location set to Australia.

But can I be sure that all installations of PHP, perhaps in different
countries and on different operating systems will interpret dates the same?

I can't find much mention of this question online or in the manual.

Any help much appreciated.
Angus


Angus:

You are running into a problem that cannot be solved by allowing the user to
do whatever they want. As you realize, if I enter 01-02-09 you don't know if
I mean January 2, 2009 or February 1, 2009 and there is no way to figure out
what I meant.

The solution is simply to use the html  and give the user that way
to enter month and day.

I would set it to day-month-year and let US visitors live with it for I
personally think that's a better format.

Cheers and Merry Christmas.

tedd


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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




I would agree with tedd. Use a JS calendar widget (requires js) or use
three select boxes for mm , dd and year



I developed my little text input AJAX (see earlier post) to work around the fact 
that a LOT of users I encountered were cheesed off by JS calendar widgets, 
especially when the date to be entered was a long way from the current date 
(such as a date of birth). I tried implementing some scroll-wheel events to 
speed up year selection on one of these but it was tricky to get cross-browser 
support.


Drop-downs are a pain when you have to scroll back 40+ years to find the right 
one and are implicitly limited by how far back and forward the designer expects 
to need, and then you have the problem of validating the days and months (which, 
to be fair, is a pretty simple javascript task)


I suspect that with a bit of thought I could put together a Javascript date 
validator that parsed most possible inputs and produced a sensible 
interpretation of them, but I was lazy and had AJAX machinery set up already in 
my project.
--- End Message ---
--- Begin Message ---
2009/12/30 Tony Marston :
> 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:/

php-general Digest 4 Jan 2010 09:51:32 -0000 Issue 6520

2010-01-04 Thread php-general-digest-help

php-general Digest 4 Jan 2010 09:51:32 - Issue 6520

Topics (messages 300787 through 300791):

Re: Instll php on Window 2003 64Bit questions
300787 by: Daniel Egeberg
300791 by: Richard Quadling

Re: If design patterns are not supposed to produce reusable code then why use 
them?
300788 by: Tony Marston
300789 by: tedd
300790 by: Daniel Egeberg

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 ---
On Sun, Jan 3, 2010 at 08:10, Edward S.P. Leong  wrote:
> Dear All,
>
> If the OS is Windows 2003 64Bit (IIS)...
> So, which php package must download and how to config it for running
> with IIS ?
> Due to I don't quite the online manual:
> http://www.php.net/manual/en/install.windows.iis.php
> Which installation mode is suitable of it ?
>
> Thanks !
>
> Edward.

Do you mean which of the two IIS installation guides in the manual you
should follow? IIS7 is from Windows Vista (or Windows Server 2008) and
up, so you would have to go with the first link. So you can download
the PHP 5.3.1 VC9 non-thread-safe build from http://windows.php.net
and follow the steps in
http://www.php.net/manual/en/install.windows.iis6.php.

-- 
Daniel Egeberg
--- End Message ---
--- Begin Message ---
2010/1/3 Ashley Sheridan :
> On Sun, 2010-01-03 at 15:10 +0800, Edward S.P. Leong wrote:
>
>> Dear All,
>>
>> If the OS is Windows 2003 64Bit (IIS)...
>> So, which php package must download and how to config it for running
>> with IIS ?
>> Due to I don't quite the online manual:
>> http://www.php.net/manual/en/install.windows.iis.php
>> Which installation mode is suitable of it ?
>>
>> Thanks !
>>
>> Edward.
>>
>
>
> Personally I'd go with a WAMP install instead. Apache is faster, less
> resource intensive, and more secure than IIS. You also have the benefit
> of all the Apache mods out there, like mod_rewrite, which I believe
> you'd have to pay for on an IIS server.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

IIS7 has a URLRewrite module which is freely available via the Web
Platform Installer or via
http://learn.iis.net/page.aspx/460/using-url-rewrite-module

-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--- End Message ---
--- Begin Message ---

"Larry Garfield"  wrote in message 
news:201001010553.41956.la...@garfieldtech.com...
> On Friday 01 January 2010 05:26:48 am Tony Marston wrote:
>
>> > 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.
>>
>> Food recipes are a bad analogy for design patterns. A food recipe
>> explicitly identifies a list of ingredients and a list of actions which
>> are required to produce the intended result. The design pattern 
>> equivalent
>> of a recipe would simply state "take a bunch of ingredients, mix them up,
>> heat them up, serve them up". A design pattern merely identifies the
>> concept, not the
>> implementation, so where is the REAL benefit? Where is the re-usability?
>
> Note that I did not say that design patterns are a recipe.  I said they're
> knowledge of how different foods interact.  They're meta-knowledge that 
> makes
> you a better chef, not a faster short-order cook.

Knowledge of how foods interact will not in itself make anyone a good cook. 
Knowledge of design patterns will not in itself make anyone a good 
programmer. It is how that knowledge is applied which makes the difference. 
The problem with design patterns is that the actual implementation is left 
up to the indvidual, and if the implementation is faulty the fact that a 
design pattern was used is nothing more than a red herring.

>> > 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*. Th