php-general Digest 10 Oct 2007 14:37:22 - Issue 5065
Topics (messages 263022 through 263041):
Re: Beginner Tutorials for using CLASSES in PHP4
263022 by: Nathan Nobbe
263026 by: tedd
263028 by: Tony Marston
263029 by: Tony Marston
263032 by: Nathan
Robert Cummings wrote:
On Tue, 2007-10-09 at 15:28 -0500, Jay Blanchard wrote:
[snip]
This *IS* the knapsack problem. Just because you specify date ranges
to get your values and the value isn't a knapsack doesn't change the
fact that it is the same problem :) I remember having fun with
On 09/10/2007, Jay Blanchard [EMAIL PROTECTED] wrote:
Good afternoon gurus and guru-ettes!
I am searching for an algorithm that will take a list of monetary values
and determine which of these values totals a value supplied to the
widget.
1. I supply a value to the application and give a
[snip]
it is a special case of the knapsack problem - the subset sum problem.
You'll need to be aware that it's of exponential complexity. So make
sure your lists of possible values don't get big. Anyway, here's my
answer:
[/snip]
Thanks to all who responded, some very cool solutions and some
I have a two-dimensional array that looks like this:
array(
array(0, 123),
array(0, 234),
array(0, 345),
array(0, 456)
)
I want to REMOVE any element that contains 234, and I want to
INCREMENT the first value for any element that contains 345, to make
it look
Larry Garfield [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Tuesday 09 October 2007, Tony Marston wrote:
I have bought and read several books on design patterns without being
impressed. I have seen countless examples of how particular design
patterns
can be implemented,
tedd [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote:
i hope i have been able to contribute something to someone
amidst all the arguing.
-nathan
Yeah, you gave me a better appreciation of some of the members of this
list -- we have
At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote:
i hope i have been able to contribute something to someone
amidst all the arguing.
-nathan
Yeah, you gave me a better appreciation of some of the members of
this list -- we have some smart people here (i.e., Rob, Tony, Larry).
Cheers,
tedd
Colin Guthrie wrote:
What do you think of this?
http://webbytedd.com/b/timed-php/
It's a combination of using both ajax and php together.
I'd say overkill for the end result (could be done in plain Javascript
without any Ajax calls),
That was my reaction too. I've used iframe/rpc for
Brian Dunning wrote:
I have a two-dimensional array that looks like this:
array(
array(0, 123),
array(0, 234),
array(0, 345),
array(0, 456)
)
I want to REMOVE any element that contains 234, and I want to INCREMENT
the first value for any element that contains 345, to make it
On 10/10/07, tedd [EMAIL PROTECTED] wrote:
At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote:
i hope i have been able to contribute something to someone
amidst all the arguing.
-nathan
Yeah, you gave me a better appreciation of some of the members of
this list -- we have some smart people
On Wed, 2007-10-10 at 07:00 -0500, Jay Blanchard wrote:
There is another ongoing thread about OOP in PHP4 that has approached
holy war status. I fear that some are overlooking solutions to problems
that already have been solved. Things such as interfaces and design
patterns exist because they
On Wed, 2007-10-10 at 08:55 -0400, tedd wrote:
At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote:
i hope i have been able to contribute something to someone
amidst all the arguing.
-nathan
Yeah, you gave me a better appreciation of some of the members of
this list -- we have some smart
Nathan Nobbe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 10/9/07, Tony Marston [EMAIL PROTECTED] wrote:
Nathan Nobbe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 10/9/07, Tony Marston [EMAIL PROTECTED] wrote:
There's your problem, then. You are wasting
Nathan Nobbe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 10/9/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Tue, 2007-10-09 at 21:37 -0400, Nathan Nobbe wrote:
does a lawn mower not have blades; and gas and a control panel; does it
not
have
wheels? my object
On Wed, 2007-10-10 at 14:36 +0100, Stut wrote:
Brian Dunning wrote:
A pint of cachaça to he who sets me on the path to success.
Don't really know what that is, but OK!
I'll be back with your pint a minute... right now I have to go to the
washroom... why am I carrying this empty pint
On Wed, 2007-10-10 at 14:44 +0100, Tony Marston wrote:
Nathan Nobbe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 10/9/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Tue, 2007-10-09 at 21:37 -0400, Nathan Nobbe wrote:
does a lawn mower not have blades; and gas and a
On 10/10/07, Tony Marston [EMAIL PROTECTED] wrote:
Nathan Nobbe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 10/9/07, Tony Marston [EMAIL PROTECTED] wrote:
Nathan Nobbe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 10/9/07, Tony Marston [EMAIL
Robert Cummings wrote:
On Wed, 2007-10-10 at 14:36 +0100, Stut wrote:
Brian Dunning wrote:
A pint of cachaça to he who sets me on the path to success.
Don't really know what that is, but OK!
I'll be back with your pint a minute... right now I have to go to the
washroom... why am I carrying
On 10/10/07, Tony Marston [EMAIL PROTECTED] wrote:
Nathan Nobbe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 10/9/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Tue, 2007-10-09 at 21:37 -0400, Nathan Nobbe wrote:
does a lawn mower not have blades; and gas and a
On 10/9/07, Jay Blanchard [EMAIL PROTECTED] wrote:
[snip]
I need to extract the text from a PDF file for
storage in the database.
[/snip]
It depends. If the PDF is an image file you cannot do it with PHP.
http://www.php.net/pdf read the second user note
[snip]
Madison, WI 53703
If the OP wants any single valid set, then this seems to work.
If he wants all valid sets, no joy.
I added a 10.00 and a 0.22 to the $values array and varied the position of the
10.00 (before and after 3.76) and it seems to pull the first set where the
first member in the $values array is a
[snip]
If the OP wants any single valid set, then this seems to work.
If he wants all valid sets, no joy.
I added a 10.00 and a 0.22 to the $values array and varied the position
of the 10.00 (before and after 3.76) and it seems to pull the first set
where the first member in the $values array is a
At 12:30 PM -0700 10/9/07, Jim Lucas wrote:
tedd wrote:
Thanks for the code. I've altered it to display a table in a browser:
http://webbytedd.com/bbb/table/
Code is shown there.
-snip-
I wouldn't use that to display tabular data in a browser.
I will attach what I use to display in a
At 12:30 PM -0700 10/9/07, Jim Lucas wrote:
tedd wrote:
At 12:05 AM -0700 10/9/07, Jim Lucas wrote:
Daevid Vincent wrote:
Does PHP have any tools like this? I'd prefer not to pull in some PEAR
package or other bloat, but I'll take what I can get if it actually works
well. I was hoping there
Hi. I have installed PHP ~ a dozen times on Windows and *nix systems, so I
don't consider myself to be a newbie at this. However, I've run into a
problem that I have run out of ideas. I have Google'd many sites and none of
the suggestions provided worked for me. Specs:
PHP 5.2.4 (Manual install)
Philip Thompson wrote:
Hi. I have installed PHP ~ a dozen times on Windows and *nix systems, so I
don't consider myself to be a newbie at this. However, I've run into a
problem that I have run out of ideas. I have Google'd many sites and none of
the suggestions provided worked for me. Specs:
and here is the interface example youve (Tony) been asking for.
the reason an interface is the best option here is because human hands and
grass are not related,
but they can both be cut (i didnt start the fingers thing, but it works for
the example so im using it).
also, notice the benefit of
All your examples all falling on deaf ears. The fact of the matter is that
encapsulation does NOT mean data hiding, therefore I do NOT have to make all
my member variables private.
The fact that you have used interfaces in that example proves nothing to me.
It is possible to code a solution
On 10/10/07, Tony Marston [EMAIL PROTECTED] wrote:
All your examples all falling on deaf ears. The fact of the matter is that
encapsulation does NOT mean data hiding, therefore I do NOT have to make
all
my member variables private.
i thought we agreed to disagree on that point; im done
On 10/10/07, Don Proshetsky [EMAIL PROTECTED] wrote:
Hi,
I have a field in which a user inputs a Windows style directory path,
hence
using backslashes and not forward slashes.
Example: c:\qb\data\mydatadile.qbw
However, when the use clicks update, what gets saved is:
Hi gang:
While we're entertaining algorithms, has anyone else noticed that
php's round() isn't the most accurate algorithm to round?
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To
On 10/10/07, tedd [EMAIL PROTECTED] wrote:
Hi gang:
While we're entertaining algorithms, has anyone else noticed that
php's round() isn't the most accurate algorithm to round?
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
Yes. sprintf
On 10/10/07, Larry Garfield [EMAIL PROTECTED] wrote:
On Wed, 10 Oct 2007 13:39:31 -0400, Nathan Nobbe [EMAIL PROTECTED]
wrote:
The fact that you have used interfaces in that example proves nothing to
me.
It is possible to code a solution which does not use interfaces, so
what
are
On 10/10/07, tedd [EMAIL PROTECTED] wrote:
Hi gang:
While we're entertaining algorithms, has anyone else noticed that
php's round() isn't the most accurate algorithm to round?
there is a function that uses the bc math library on the bc math
pagehttp://www.php.net/manual/en/ref.bc.php
;
[snip]
so what are the benefits of the with interfaces solution over
thewithout
interfaces solution
[/snip]
Polymorphism.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 10/10/07, Tony Marston [EMAIL PROTECTED] wrote:
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
so what are the benefits of the with interfaces solution over
thewithout interfaces solution
[/snip]
Polymorphism.
Are you saying that it is not possible
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
so what are the benefits of the with interfaces solution over
thewithout interfaces solution
[/snip]
Polymorphism.
Are you saying that it is not possible to have polymorphism without using
interfaces? If so you
I didn't see all the responses to this, so maybe someone already recommended
these things.
Looks like you may be over-complicating things in your code there.
First, if Magic Quotes are ON, then you probably want to stripslashes() to
get rid of extra slashes. If it's OFF, then don't worry
While we're entertaining algorithms, has anyone else noticed that
php's round() isn't the most accurate algorithm to round?
For those that replied that there is a problem, can you provide examples?
precision
The optional number of decimal digits to round to, defaults to 0
Nathan Nobbe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 10/10/07, Tony Marston [EMAIL PROTECTED] wrote:
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
so what are the benefits of the with interfaces solution over
thewithout interfaces
[snip]
I wouldn't play with a lawnmower class in the first place. I use PHP to
write web applications which deal with database tables, not lawnmowers,
and
I have yet to find a good reason for using interfaces in such
applications.
Your contrived examples do not convince me of anything.
[/snip]
On Wed, 2007-10-10 at 13:30 -0500, Jay Blanchard wrote:
[snip]
so what are the benefits of the with interfaces solution over
thewithout
interfaces solution
[/snip]
Polymorphism.
Bleh, polymorphism isn't unique to interfaces. In fact, PHP has
polymorphism all over the place by virtue of
While we're entertaining algorithms, has anyone else noticed that
php's round() isn't the most accurate algorithm to round?
If you will refer to chafy's reply on 28-Feb-2007 06:13
http://us2.php.net/manual/en/function.round.php#73537
The function round numbers to a given precision.
why not try searching the c:/windows folder for a copy of the php.ini file?
Maybe there is a straggler that needs to be deleted.
Bastien Date: Wed, 10 Oct 2007 17:24:54 +0100 From: [EMAIL PROTECTED] To:
[EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] IIS 6 and
php.ini
On 10/10/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Wed, 2007-10-10 at 13:30 -0500, Jay Blanchard wrote:
[snip]
so what are the benefits of the with interfaces solution over
thewithout
interfaces solution
[/snip]
Polymorphism.
Bleh, polymorphism isn't unique to interfaces.
use mysql_real_escape_string
bastien From: [EMAIL PROTECTED] To: php-general@lists.php.net Date: Wed, 10
Oct 2007 13:48:03 -0400 Subject: [PHP] How do I get PHP to save a backslash in
a Mysql table? Hi, I have a field in which a user inputs a Windows style
directory path, hence using
At 9:38 AM -0400 10/10/07, Nathan Nobbe wrote:
On 10/10/07, tedd mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote:
At 9:54 PM -0400 10/9/07, Nathan Nobbe wrote:
i hope i have been able to contribute something to someone
amidst all the arguing.
-nathan
Yeah, you gave me a better
At 3:27 PM +0200 10/10/07, Per Jessen wrote:
Colin Guthrie wrote:
What do you think of this?
http://webbytedd.com/b/timed-php/
It's a combination of using both ajax and php together.
I'd say overkill for the end result (could be done in plain Javascript
without any Ajax calls),
That
On 10/10/07, Don Proshetsky [EMAIL PROTECTED] wrote:
Hi,
I have a field in which a user inputs a Windows style directory path, hence
using backslashes and not forward slashes.
Example: c:\qb\data\mydatadile.qbw
However, when the use clicks update, what gets saved is:
On 10/10/07, Bastien Koert [EMAIL PROTECTED] wrote:
why not try searching the c:/windows folder for a copy of the php.inifile?
Maybe there is a straggler that needs to be deleted.
Bastien - That may be a possibility... except I just built the machine
yesterday, so I know php.ini is not in
Why arent you just using sprintf?
$var = 5.555;
printf(%.2f, $var); # output : 5.56
printf(%.1f, $var); # output : 5.6
printf(%.0f, $var); # output : 6
On 10/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
While we're entertaining algorithms, has anyone else noticed that
php's round()
On 10/10/07, Robert Cummings [EMAIL PROTECTED] wrote:
What I was really illustrating is how interfaces are syntactic
sugar only. In my above example what I've really shown is an
implicit interface :) Since OOP is largely meant to model real
world things, ask yourself this... when a doctor
On Wed, 2007-10-10 at 17:46 -0400, Nathan Nobbe wrote:
On 10/10/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Wed, 2007-10-10 at 13:30 -0500, Jay Blanchard wrote:
[snip]
so what are the benefits of the with interfaces solution
over
thewithout
On Wed, 2007-10-10 at 17:46 -0400, Nathan Nobbe wrote:
On 10/10/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Wed, 2007-10-10 at 13:30 -0500, Jay Blanchard wrote:
[snip]
so what are the benefits of the with interfaces solution
over
thewithout
On Wed, 2007-10-10 at 20:45 -0400, Nathan Nobbe wrote:
On 10/10/07, Robert Cummings [EMAIL PROTECTED] wrote:
What I was really illustrating is how interfaces are syntactic
sugar only. In my above example what I've really shown is an
implicit interface :) Since OOP is largely meant to
On Wed, 2007-10-10 at 20:57 -0500, Larry Garfield wrote:
On Wednesday 10 October 2007, Nathan Nobbe wrote:
On 10/10/07, Robert Cummings [EMAIL PROTECTED] wrote:
What I was really illustrating is how interfaces are syntactic
sugar only. In my above example what I've really shown is an
On Wednesday 10 October 2007, Nathan Nobbe wrote:
On 10/10/07, Robert Cummings [EMAIL PROTECTED] wrote:
What I was really illustrating is how interfaces are syntactic
sugar only. In my above example what I've really shown is an
implicit interface :) Since OOP is largely meant to model real
well i have to say i dont really see the difference between an implicit and
explicit interface.
the example you gave looks like it works just like the example i gave.
in your example the check for the function is performed at runtime.
in the example i gave the check for the interface is
On Wed, 2007-10-10 at 22:15 -0400, Nathan Nobbe wrote:
well i have to say i dont really see the difference between an
implicit and explicit interface.
the example you gave looks like it works just like the example i gave.
in your example the check for the function is performed at runtime.
On 10/10/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Wed, 2007-10-10 at 22:15 -0400, Nathan Nobbe wrote:
well i have to say i dont really see the difference between an
implicit and explicit interface.
the example you gave looks like it works just like the example i gave.
in your
61 matches
Mail list logo