OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
php-general Digest 11 Oct 2008 00:28:33 -0000 Issue 5728

php-general-digest-helplists.php.net
Date: Fri Oct 10 2008 - 19:28:33 CDT


php-general Digest 11 Oct 2008 00:28:33 -0000 Issue 5728

Topics (messages 281664 through 281704):

returning array from commandline
        281664 by: Ian
        281665 by: Per Jessen
        281666 by: Ian
        281667 by: Per Jessen

Re: [Semi-OT] Tonns of jobs available
        281668 by: Boyd, Todd M.
        281671 by: Nathan Rixham
        281672 by: tedd
        281673 by: Richard Heyes
        281678 by: TG
        281679 by: Boyd, Todd M.
        281684 by: Nathan Rixham
        281689 by: tedd
        281690 by: Daniel Brown
        281701 by: Ashley Sheridan
        281702 by: tedd
        281704 by: Nathan Rixham

Re: Manipulating strings
        281669 by: \"Crash\" Dummy

Oops!
        281670 by: \"Crash\" Dummy

Re: Plotting Tool
        281674 by: \"Crash\" Dummy
        281676 by: Thodoris
        281677 by: Richard Heyes
        281681 by: Boyd, Todd M.
        281700 by: Ashley Sheridan

Re: Best Search Algorithm for Millions of record
        281675 by: Thodoris

Re: The 'at' sign () variable prefix
        281680 by: ANR Daemon

Re: Crowd-sourcing woes - Was: [Semi-OT] Tonns of jobs available
        281682 by: Boyd, Todd M.

Re: strtotime problem
        281683 by: ANR Daemon
        281688 by: Thodoris

Passing a variable which is an aggregate function
        281685 by: The Doctor
        281686 by: Jim Lucas
        281687 by: Andrew Ballard

Problem with memory management
        281691 by: Alan Boudreault
        281692 by: Nathan Rixham
        281693 by: Eric Butera
        281694 by: Nathan Rixham

Jobs
        281695 by: Kyle Terry
        281697 by: Daniel Brown

Re: Crowd-sourcing woes [Semi-OT]
        281696 by: Boyd, Todd M.
        281703 by: tedd

Library GD dont work
        281698 by: opc.orenses.com

Variable Variables and Super Global Arrays
        281699 by: daniel danon

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


Hi,

I am busy developing a commandline tool that will, in certain
cirumstances, return an array of information when called and im having
a problem with this.

The last part of my code looks like this:

if(is_array($rslt)) return $rslt;
else echo $rslt;

I.e. if its an array dont echo it, return it rather and im have huge
problems even using that $rslt variable. I have tried various exec
queries including exec() (with var before function call and as a
parameter), passthru, backtick operators and none of them allow me to
use the array after the commandline tool has been run.

I also dont know how many levels the array may have as im referencing
other functions that change them based on the query given to the
commandline tool so I cant even put it into a string before returning
it as i dont know how many levels are involved and are returned from
the function call inside the commandline app. Does anyone have any
suggestions as to how I could achieve this or any better ways of doing
it?

Quick summary: Im accessing a web interface that calls a php file to
parse some info. That php file may get an array back that I need to
use in the web interface - but I cant pass it back to the web
interface from the commandline tool.

Thanks
Ian

attached mail follows:


Ian wrote:

> I am busy developing a commandline tool that will, in certain
> cirumstances, return an array of information when called and im having
> a problem with this.

Ian, that's a bit of a contradiction - a command line tool returns a
return code.

> The last part of my code looks like this:
>
> if(is_array($rslt)) return $rslt;
> else echo $rslt;
>
> I.e. if its an array dont echo it, return it rather and im have huge
> problems even using that $rslt variable. I have tried various exec
> queries including exec() (with var before function call and as a
> parameter), passthru, backtick operators and none of them allow me to
> use the array after the commandline tool has been run.

Exactly - the array is a PHP construct, once you've called the command
script, you've moved into your basic OS environment - which doesn't
understand about PHP arrays.

> Quick summary: Im accessing a web interface that calls a php file to
> parse some info. That php file may get an array back that I need to
> use in the web interface - but I cant pass it back to the web
> interface from the commandline tool.

Why does it have to be called as a command line tool? Why not just call
it as a plain PHP function?

/Per Jessen, Zürich

attached mail follows:


On Fri, Oct 10, 2008 at 3:47 PM, Per Jessen <percomputer.org> wrote:
> Ian wrote:
>
>> I am busy developing a commandline tool that will, in certain
>> cirumstances, return an array of information when called and im having
>> a problem with this.
>
> Ian, that's a bit of a contradiction - a command line tool returns a
> return code.
>

Yep, my bad - thats bad english - it was talking about the output that
the commandline tool spews out - i was hoping to return the entire
array for use within the web interface.

>> The last part of my code looks like this:
>>
>> if(is_array($rslt)) return $rslt;
>> else echo $rslt;
>>
>> I.e. if its an array dont echo it, return it rather and im have huge
>> problems even using that $rslt variable. I have tried various exec
>> queries including exec() (with var before function call and as a
>> parameter), passthru, backtick operators and none of them allow me to
>> use the array after the commandline tool has been run.
>
> Exactly - the array is a PHP construct, once you've called the command
> script, you've moved into your basic OS environment - which doesn't
> understand about PHP arrays.

Thats what i suspected - was just taking a gamble that someone would
have an ideal solution and make my life much easier :) ill have to
manually add some switch cases for different result sets and then a
decompile function on the other end.

>
>> Quick summary: Im accessing a web interface that calls a php file to
>> parse some info. That php file may get an array back that I need to
>> use in the web interface - but I cant pass it back to the web
>> interface from the commandline tool.
>
> Why does it have to be called as a command line tool? Why not just call
> it as a plain PHP function?

I have to use it as I cant include some required files into my web ui
as they interfere with the base system (not one i wrote) and it causes
all sorts of havoc so I have resorted to creating a "bridge" to
combine the two systems which is where this problem comes in.

Many thanks :)

>
>
> /Per Jessen, Zürich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Ian wrote:

> On Fri, Oct 10, 2008 at 3:47 PM, Per Jessen <percomputer.org> wrote:
>> Ian wrote:
>>
>>> I am busy developing a commandline tool that will, in certain
>>> cirumstances, return an array of information when called and im
>>> having a problem with this.
>>
>> Ian, that's a bit of a contradiction - a command line tool returns a
>> return code.
>>
>
> Yep, my bad - thats bad english - it was talking about the output that
> the commandline tool spews out - i was hoping to return the entire
> array for use within the web interface.

Got it - yes, that should be possible, but only in text format. Have
you looked at the output array parameter from the exec() call?

What you might be able to is print out the serialized form of the array,
and the deserialize in the calling function? Bit of round-about way,
but it might work.

>>> Quick summary: Im accessing a web interface that calls a php file to
>>> parse some info. That php file may get an array back that I need to
>>> use in the web interface - but I cant pass it back to the web
>>> interface from the commandline tool.
>>
>> Why does it have to be called as a command line tool? Why not just
>> call it as a plain PHP function?
>
> I have to use it as I cant include some required files into my web ui
> as they interfere with the base system (not one i wrote) and it causes
> all sorts of havoc so I have resorted to creating a "bridge" to
> combine the two systems which is where this problem comes in.

Ah, now it makes sense. Then you've just got to work out the
interface - maybe the serialize/deserialize I mentioned above. Or you
could let the command line stuff write to a file that you'd then read
back from the web ui.

/Per Jessen, Zürich

attached mail follows:


> -----Original Message-----
> From: Michelle Konzack [mailto:linux4michelletamay-dogan.net]
> Sent: Thursday, October 09, 2008 6:38 PM
> To: PHP - General
> Subject: [PHP] [Semi-OT] Tonns of jobs available
>
> Hello,
>
> For those who are seeking for PHP jobs (small and big ones), I
> can recomment you the Website
>
> <http://www.GetACoder.com/>
>
> I get, since several years, my jobs there, but I am currently
> overworked to use it... ;-)
>
> Most jobs are even payed using PayPal... which mean, you can even
> do the Job occasional privately withpout paying any fiscal tax... :-D

www.rentacoder.com
www.scriptlance.com

...and probably a hundred others. I just find I'm often drastically
outbid by someone from a developing 2nd-world nation that doesn't mind
building and designing an entire corporate web application for $10 ($3
of which is generally taken by the crowd-sourcing site on which the
transaction takes place).

The thing is, though, that I'm sure a lot of those jobs go unfinished or
are "finished" sloppily. When people stop caring so much about squeezing
their dollar, and start to care about actually getting a good product
from their seller/coder relationship, I might get back into it.

Todd Boyd
Web Programmer

attached mail follows:


Boyd, Todd M. wrote:
>> -----Original Message-----
>> From: Michelle Konzack [mailto:linux4michelletamay-dogan.net]
>> Sent: Thursday, October 09, 2008 6:38 PM
>> To: PHP - General
>> Subject: [PHP] [Semi-OT] Tonns of jobs available
>>
>> Hello,
>>
>> For those who are seeking for PHP jobs (small and big ones), I
>> can recomment you the Website
>>
>> <http://www.GetACoder.com/>
>>
>> I get, since several years, my jobs there, but I am currently
>> overworked to use it... ;-)
>>
>> Most jobs are even payed using PayPal... which mean, you can even
>> do the Job occasional privately withpout paying any fiscal tax... :-D

what a fantastic comment to attach to your full personal details and
indeed company :D

>
> www.rentacoder.com
> www.scriptlance.com
>
> ...and probably a hundred others. I just find I'm often drastically
> outbid by someone from a developing 2nd-world nation that doesn't mind
> building and designing an entire corporate web application for $10 ($3
> of which is generally taken by the crowd-sourcing site on which the
> transaction takes place).

on that note; I found a lucrative little spot on scriptlance
remaking/bug fixing the lower quality work for maybe not normal, but
certainly decent, rates.

attached mail follows:


At 9:36 AM -0500 10/10/08, Boyd, Todd M. wrote:
>www.rentacoder.com
>www.scriptlance.com
>
>...and probably a hundred others. I just find I'm often drastically
>outbid by someone from a developing 2nd-world nation that doesn't mind
>building and designing an entire corporate web application for $10 ($3
>of which is generally taken by the crowd-sourcing site on which the
>transaction takes place).
>
>The thing is, though, that I'm sure a lot of those jobs go unfinished or
>are "finished" sloppily. When people stop caring so much about squeezing
>their dollar, and start to care about actually getting a good product
>from their seller/coder relationship, I might get back into it.

I had a paid account with guru.com and spent a full year answering
proposals (> 100) -- I didn't get a single job. It was a complete
waste of time for me, but I am sure it works for others.

I just landed a client who had a very bad experience with rentacoder.
So, it appears that the 2nd-world nation programming experience is
providing some kick-back work for honest programmers. At least I
receive more business from people who have had problems with "cheap"
programming than those high-profile sites who sell "cheap"
programming serves.

Cheers,

tedd

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

attached mail follows:


> When people stop caring so much about squeezing
> their dollar

I don't see that happening any time soon... :-)

--
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

attached mail follows:


I had a free Guru.com account when I was working freelance and job hunting
and all that, and I didn't bother submitting a single proposal because I
could see how all the jobs went. People would submit a reasonable proposal
and eventually it would get to the point where someone was bidding $1 to do
the job. That was $1 plus $5,000 or something in "additional work" or some
stupidity.

I wasn't about to jump into a pit of idiots and compete in an obviously
losing battle with unscrupulous bidders. Regardless of whether they were
overseas or not, it's still a losing proposition for someone like me. Not
only do you have to compete with unfair bidding practices and predatory
sales people, but you have to fight the stigma of the innevitable crap jobs
all these other guys may be doing and have to prove yourself above and
beyond what you'd have to.

Not to mention, if you DO get a proposal from someone who's been burnt
before, there's a higher likelihood that they're going to put unreasonable
demands on you, hoping to control the 'burn' the second time around.
Blarg. Screw it. hah

-TG

----- Original Message -----
From: tedd <tedd.sperlinggmail.com>
To: <php-generallists.php.net>
Date: Fri, 10 Oct 2008 11:13:11 -0400
Subject: RE: [PHP] [Semi-OT] Tonns of jobs available

> At 9:36 AM -0500 10/10/08, Boyd, Todd M. wrote:
> >www.rentacoder.com
> >www.scriptlance.com
> >
> >...and probably a hundred others. I just find I'm often drastically
> >outbid by someone from a developing 2nd-world nation that doesn't mind
> >building and designing an entire corporate web application for $10 ($3
> >of which is generally taken by the crowd-sourcing site on which the
> >transaction takes place).
> >
> >The thing is, though, that I'm sure a lot of those jobs go unfinished or
> >are "finished" sloppily. When people stop caring so much about squeezing
> >their dollar, and start to care about actually getting a good product
> >from their seller/coder relationship, I might get back into it.
>
> I had a paid account with guru.com and spent a full year answering
> proposals (> 100) -- I didn't get a single job. It was a complete
> waste of time for me, but I am sure it works for others.
>
> I just landed a client who had a very bad experience with rentacoder.
> So, it appears that the 2nd-world nation programming experience is
> providing some kick-back work for honest programmers. At least I
> receive more business from people who have had problems with "cheap"
> programming than those high-profile sites who sell "cheap"
> programming serves.
>
> Cheers,
>
> tedd

attached mail follows:


> -----Original Message-----
> From: richard.heyesgmail.com [mailto:richard.heyesgmail.com] On
> Behalf Of Richard Heyes
> Sent: Friday, October 10, 2008 10:15 AM
> To: Boyd, Todd M.
> Cc: php-generallists.php.net
> Subject: Re: [PHP] [Semi-OT] Tonns of jobs available
>
> > When people stop caring so much about squeezing
> > their dollar
>
> I don't see that happening any time soon... :-)

It always happens. At least... it always happens eventually in companies
that stay in existence. Eventually, they figure out that it costs them
more money to go back and fix crap-tastic code 4 or 5 times than it does
to just pay well to code it right in the first place.

Now, if I could just get hold of them AFTER they've decided to address
the problem, and not just the symptoms of their floundering code...

Todd Boyd
Web Programmer

attached mail follows:


Richard Heyes wrote:
>> When people stop caring so much about squeezing
>> their dollar
>
> I don't see that happening any time soon... :-)
>

ahh but they'll be squeezing their amero's soon

which incidentally sounds rather funny

attached mail follows:


At 11:46 AM -0400 10/10/08, TG wrote:
>I had a free Guru.com account when I was working freelance and job hunting
>and all that, and I didn't bother submitting a single proposal because I
>could see how all the jobs went. People would submit a reasonable proposal
>and eventually it would get to the point where someone was bidding $1 to do
>the job. That was $1 plus $5,000 or something in "additional work" or some
>stupidity.

I had one guy respond to my bid and ask how much I charged. I replied
"$50 per hour".

To which he said "$50! I never paid more than $25 per hour -- will
you work for that?"

I replied "Sure, but it's going to take me twice as long to get anything done."

I didn't get the job.

Actually, if I really punched a time clock, I'm probably making
around $25 per hour (or less) anyway. It's a good thing I love the
work, but it's usually the clients who are the main problem. Too bad
they often stand in the way of what they really want done.

I had another respond to my bid. They wanted a way they could upload
Word documents to a server and have them automagically become pdf
files. I said, "Why don't you just do it directly from Word?" Poof --
I lost that contract.

Another said that they wanted a way to upload pdf files and then
inject input fields directly into the uploaded pdf file.

I told them that's not an easy thing to do considering how PDF files
are constructed. So I suggested creating an online form and
generating pdf files on the fly. I even made a demo for them to use.
But, the client said "No, we need to be able use our existing pdf
files.

So, I researched the hell out of it some more and came to the
conclusion that it would be very difficult and told them so.

They answered "Oh, don't worry about it, we already found someone who
can do it. He showed us a way that we could use an online form and
generate pdf files on the fly."

Duh!

Is everyone stupid or is it just me? :-)

Cheers,

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

attached mail follows:


On Fri, Oct 10, 2008 at 2:54 PM, tedd <tedd.sperlinggmail.com> wrote:
>
> Is everyone stupid or is it just me? :-)

    No, you're not the only one. You're in good company.

--
</Daniel P. Brown>
More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

attached mail follows:


On Fri, 2008-10-10 at 14:54 -0400, tedd wrote:
> At 11:46 AM -0400 10/10/08, TG wrote:
> >I had a free Guru.com account when I was working freelance and job hunting
> >and all that, and I didn't bother submitting a single proposal because I
> >could see how all the jobs went. People would submit a reasonable proposal
> >and eventually it would get to the point where someone was bidding $1 to do
> >the job. That was $1 plus $5,000 or something in "additional work" or some
> >stupidity.
>
> I had one guy respond to my bid and ask how much I charged. I replied
> "$50 per hour".
>
> To which he said "$50! I never paid more than $25 per hour -- will
> you work for that?"
>
> I replied "Sure, but it's going to take me twice as long to get anything done."
>
> I didn't get the job.
>
> Actually, if I really punched a time clock, I'm probably making
> around $25 per hour (or less) anyway. It's a good thing I love the
> work, but it's usually the clients who are the main problem. Too bad
> they often stand in the way of what they really want done.
>
> I had another respond to my bid. They wanted a way they could upload
> Word documents to a server and have them automagically become pdf
> files. I said, "Why don't you just do it directly from Word?" Poof --
> I lost that contract.
>
> Another said that they wanted a way to upload pdf files and then
> inject input fields directly into the uploaded pdf file.
>
> I told them that's not an easy thing to do considering how PDF files
> are constructed. So I suggested creating an online form and
> generating pdf files on the fly. I even made a demo for them to use.
> But, the client said "No, we need to be able use our existing pdf
> files.
>
> So, I researched the hell out of it some more and came to the
> conclusion that it would be very difficult and told them so.
>
> They answered "Oh, don't worry about it, we already found someone who
> can do it. He showed us a way that we could use an online form and
> generate pdf files on the fly."
>
> Duh!
>
> Is everyone stupid or is it just me? :-)
>
> Cheers,
>
> tedd
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
We've all been there. I put together a site at work, and despite my best
efforts, the girl who is in-charge of adding content keeps making the
same mistakes, like trying to upload a PDF in a field clearly marked CSV
(and then wondering why it doesn't work) or adding a new article and
wonder why it doesn't appear in date order if she doesn't specify a date
(articles often get added at times other than they occur) or why when
she uploads a 1024*768 BMP file, the site has trouble converting it,
despite asking for a much smaller JPG file! All these problems are just
on one site and with one woman. My whole base is like this!

Ash
www.ashleysheridan.co.uk

attached mail follows:


At 12:38 AM +0100 10/11/08, Ashley Sheridan wrote:
>All these problems are just on one site and with one woman.
>
>Ash

I won't comment on that, other than say -- while they may all look
different, there's really only one woman. It's an ant-like thing. :-)

Cheers,

tedd

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

attached mail follows:


tedd wrote:
> At 12:38 AM +0100 10/11/08, Ashley Sheridan wrote:
>> All these problems are just on one site and with one woman.
>>
>> Ash
>
>
> I won't comment on that, other than say -- while they may all look
> different, there's really only one woman. It's an ant-like thing. :-)
>
> Cheers,
>
> tedd
>

gets me to wondering just how many hours I've wasted in my career
modifying systems to deal with what are clearly
company/management/staffing issues; in-fact I dread to think so won't.

*just doing me job*

attached mail follows:


> I have a series of questions.

> How do I count the number of <br /> 's in a string?

> How do I add text in the middle of a string, let's say after the
> 3rd <br />?

If all you want to do is count the number of line breaks, then the
substr_count function that Micah recommends will do the job. I suspect
that you are interested in more than counting paragraphs, however. To
insert an ad as you describe, I would convert the string to an array,
edit the desired element, then reconstruct the string. It's much
easier than it sounds. You can also get the number of elements in the
array, if you desire:

<?PHP
//define string
$str="text_0<br />text_1<br />text_2<br />text_3<br />text_4<br
/>text_5";

//create array of string elements and (optionally) get the number of
elements
$para=explode("<br />",$str);
$elements=count($para)

//edit the desired element(s)
$para[3]="[AD] ".$para[3];

//reconstruct the string
$str=implode("<br />",$para);
?>
--
Crash
Committed to the search for intraterrestrial intelligence.

attached mail follows:


I forgot to close a line with a semicolon.
this: $elements=count($para)
should be: $elements=count($para);
--
Crash
Committed to the search for intraterrestrial intelligence.

attached mail follows:


>> I think Richard Heyes was working on some of these, actually.
>> Not positive if it was plotting or just display, though. If you
>> check the archives, you might find something. I'm CC'ing him
>> personally, too.

>> Here's one link of his I have from memory:

>> http://www.phpguru.org/RGraph_dev/examples/bar.html

> Working on it yes, but until MSIE supports the canvas tag (part of
> HTML5) it's not really usable for providing graphs to the public.

Will it work with Firefox?
--
Crash
Committed to the search for intraterrestrial intelligence.

attached mail follows:


> actually a little bit closer to meeting the CSS2 requirements now,
> surely we should applaud them that effort, or maybe send them a cake ;)
>
> ps, for those that don't know, I'm referring to the cake M$ sent Firefox
> congratulating them on shipping Fx3!
>
>
> Ash
> www.ashleysheridan.co.uk
>
>

Has this really happened? =-O

I might consider send them a cake too :-) .

--
Thodoris

attached mail follows:


>>> http://www.rgraph.org
>
>> Working on it yes, but until MSIE supports the canvas tag (part of
>> HTML5) it's not really usable for providing graphs to the public.
>
> Will it work with Firefox?

Yes. I use FF3 and it works entirely.

--
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

attached mail follows:


> -----Original Message-----
> From: Thodoris [mailto:tgolkinetix.gr]
> Sent: Friday, October 10, 2008 10:42 AM
> To: ashashleysheridan.co.uk
> Cc: Daniel Brown; Richard Heyes; Liz Kim; php-generallists.php.net;
> Richard Heyes
> Subject: Re: [PHP] Plotting Tool
>
> > ps, for those that don't know, I'm referring to the cake M$ sent
> Firefox
> > congratulating them on shipping Fx3!
>
> Has this really happened? =-O
>
> I might consider send them a cake too :-) .

Yes, it's real. It was, anyway:

http://www.arcanology.com/2008/06/17/ie-sends-mozilla-a-new-cake-for-fir
efox-3/

Todd Boyd
Web Programmer

attached mail follows:


On Fri, 2008-10-10 at 16:42 +0100, Richard Heyes wrote:
> >>> http://www.rgraph.org
> >
> >> Working on it yes, but until MSIE supports the canvas tag (part of
> >> HTML5) it's not really usable for providing graphs to the public.
> >
> > Will it work with Firefox?
>
> Yes. I use FF3 and it works entirely.
>
> --
> Richard Heyes
>
> HTML5 Graphing for FF, Chrome, Opera and Safari:
> http://www.rgraph.org
>
You're using Fx3 and the cake works entirely? I'm impressed. I'd have at
least expected a bug or two, like a general flour fault, or a problem
with the icing interface... You must be using Fx3 on a non-Windows
platform ;)

Ash
www.ashleysheridan.co.uk

attached mail follows:


:
> Am 2008-10-06 18:05:41, schrieb Hemant Patel:
>
>> But still i am asking...if anybody has ever worked on other Full Text Based
>> Search Algorithm then please help me to choose the best one as I need to
>> search in 160,00,000 records....
>>
>
> Realy 16 million records?
>
> I you use PostgreSQL, I recomment to use at least version 8.3 with
> "table partitioning" otherwise you could hit some limits on a singel
> table (it happen to me, but with over 200 columns and 500.000 rows)
>
> Also I recomment to use "tsearch2" which let you do fulltext search.
>
> Thanks, Greetings and nice Day/Evening
> Michelle Konzack
> Systemadministrator
> 24V Electronic Engineer
> Tamay Dogan Network
> Debian GNU/Linux Consultant
>
>
>

Another good idea could be to try mysql by partitioning your table and
use the merge tables feature to search. The problem is always, as usual,
to choose carefully the indexes but since you are searching for text
this might be hard to implement (perhaps by using search tags for every
entry but you will have to create them).

You can also post this to php-db list. You might get better answers...

--
Thodoris

attached mail follows:


Greetings, Maciek Sokolewicz.
In reply to Your message dated Thursday, October 9, 2008, 20:25:42,

>>>>> If you're using it to deal with possible empty input data, you'd better do it
>>>>> explicitly enstead.
>>>>>
>>>>> Something like this:
>>>>>
>>>>> if(!array_key_exists('from_year', $_POST)
>>>>> || !array_key_exists('from_month', $_POST)
>>>>> || !array_key_exists('from_day', $_POST)
>>>>> )
>>>>> {
>>>>> throw new Exception('No start date given', 100);
>>>>> }
>>>> *cough*
>>>>
>>>> filter_input does this elegantly too ;) as does an isset() on the array index
>>>>
>>> I'm a fan of the isset() method for POST and GET variables, as usually
>>> I'll still want to put something in the variables I'm assigning those
>>> values to, rather than the NULL which gets returned by the prefix.
>>
>> Well, filter_input does not exist in 5.1.6, and iset() does not work correctly
>> with array keys in general.
> bullshit

Like to see how people calling me... somewhat... when I'm right :)
That just making my day every now and then.

>> <?php
>>
>> $a = array ('test' => 1, 'hello' => NULL);
>>
>> var_dump(isset($a['test'])); // TRUE
>> var_dump(isset($a['foo'])); // FALSE
>> var_dump(isset($a['hello'])); // FALSE
>>
>> // The key 'hello' equals NULL so is considered unset
>> // If you want to check for NULL key values then try:
>> var_dump(array_key_exists('hello', $a)); // TRUE
>>
>> ?>
>>
>> (c) http://php.net/isset

> The only case in which isset() returns false even though it IS set is
> when the value is null. That is the _only_ difference in functionality
> between isset and array_key_exists. Let's just ignore the fact that
> isset is about a dozen times faster than array_key_exists.
> But tell me, how often do you get a NULL value from $_GET or $_POST ?
> Because let me tell you, I don't see such a value...ever... And even if
> I did see it, it would not be a VALID value.

That's not an argument in the matter of code readability, portability and
understandability.
"Better be safe than sorry" (c) folk

When you want to check if array key has meaningful value or not, disregarding
it's content and/or presence, use isset(). But that have never happened to me
in, like, 10 years. And knowing if key is present critical for foreach() cycle.

On the other side, for every my project bigger than single page I always use
purifying function to cleanup/normalize _GET/_POST/_REQUEST.
And for every project I always have list of used user variables and it's
expected types/values. If variable have been passed, required, but contains
unreliable value, I could change it to NULL (which is, as you mentioned,
cannot be set by user) to indicate that it was passed to script AND purged
in validation process. (Have never used it but having such ability is for good)

--
Sincerely Yours, ANR Daemon <anrdaemonfreemail.ru>

attached mail follows:


> -----Original Message-----
> From: TG [mailto:tg-phpgryffyndevelopment.com]
> Sent: Friday, October 10, 2008 10:47 AM
> To: php-generallists.php.net
> Subject: RE: [PHP] [Semi-OT] Tonns of jobs available
>
> I had a free Guru.com account when I was working freelance and job
> hunting
> and all that, and I didn't bother submitting a single proposal because
> I
> could see how all the jobs went. People would submit a reasonable
> proposal
> and eventually it would get to the point where someone was bidding $1
> to do
> the job. That was $1 plus $5,000 or something in "additional work" or
> some
> stupidity.
>
> I wasn't about to jump into a pit of idiots and compete in an
obviously
> losing battle with unscrupulous bidders. Regardless of whether they
> were
> overseas or not, it's still a losing proposition for someone like me.
> Not
> only do you have to compete with unfair bidding practices and
predatory
> sales people, but you have to fight the stigma of the innevitable crap
> jobs
> all these other guys may be doing and have to prove yourself above and
> beyond what you'd have to.
>
> Not to mention, if you DO get a proposal from someone who's been burnt
> before, there's a higher likelihood that they're going to put
> unreasonable
> demands on you, hoping to control the 'burn' the second time around.
> Blarg. Screw it. Hah

Heh.. my first job was to create an HTML template for this guy's product
e-mails. I set it up to where all he had to do was copy + paste and
change the images/description. It looked good, and it worked just fine.

Well.. that wasn't good enough. His template request turned into a
"Well, that's great... but what I want now is a mass e-mailing utility
and for you to teach me how to use Outlook Express!" I had bid low on
the job on purpose, as I just wanted to get at least ONE under my belt.
I was taken advantage of. Apparently he thought I was desperate, and
would be willing to shoulder one new appended request after another.

Needless to say, I had to take it into arbitration after a few
mind-blowing exercises in client arrogance and stupidity. The whole
project probably took two weeks--but the product was in its finished
form after the first day I was given the job.

Rrgh.

<?= $people == $stupid & $arrogant & $impolite ?>
TRUE

I later bid $75 on a project that I ethically could have charged $150
for. It was "done" by an individual from Pakistan who charged only $10
($65 difference! WTF?!). No doubt he took months to do it, and it was
far short of the client's par for expected results.

I guess the crowd-sourcing sites can be decent money makers if you are
predominantly involved with either fixing sloppy code (from previous
errs in the seller's judgment re: picking a worthwhile coder) or the
enterprise-level jobs that never dip below $5,000 a bid. I don't have
time for the enterprise-level projects, and fixing broken code that was
jumbled together by a million monkeys sitting at a million typewriters
in someone's basement would probably cause my brain to leak out of my
ears.

Todd Boyd
Web Programmer

attached mail follows:


Greetings, Thodoris.
In reply to Your message dated Wednesday, October 8, 2008, 16:35:40,

>> From your function name I assume you want to use it in MySQL. In that
>> case, why don't you have MySQL do all the magic for you?
>> eg. INSERT INTO table (col) VALUES (FROM_UNIXTIME($timestamp));
>> (using FROM_UNIXTIME($timestamp) will give you the date-time in "mysql
>> format" (YYYY-MM-DD HH:MM:SS) or any other format (if given via the
>> 2nd parameter)
>>

> Well I have made these two functions to solve this:

> function dateMysqlToWeb($mysqldate){

> $format = 'd/m/Y';
> $timestamp = strtotime($mysqldate);

> return date($format,$timestamp);

> }

Use SQL DATE_FORMAT instead.
Remember: Request the data you need, not the data stored.

> function dateWebToMysql($webdate){
   
> $format = 'Y-m-d';
> $date_part = explode("/",$webdate);
> $timestamp = mktime(0,0,0,$date_part[1],$date_part[0],$date_part[2]);

> return date($format,$timestamp);

> }

> My basic problem was how to make the user input from a form into a
> timestamp not how to use it with mysql. Since the format used here is
> dd/mm/yyyy I can't use the strtotime directly bacause as far as I know
> from the documentation I don't think that it changes with the timezone
> (as Stut suggested). So since strtotime understands all these variations
> like:

> mm/dd/yyyy, m/d/yy, mm/d/yy etc

Very basic solution: use 3 editboxes and short javascript sample to confirm
input.
Like
[__]/[__]/[____]
<span id="timeconfirm">...</span>
And fill 'timeconfirm' in onchange/onkeypress event, using verbal format like
Tue, Jan 03, 2008

That way, user actually see which date s/he have entered and you may use it
straightforward.

> I can't use this flexible behavior to get the input if it is not in the
> American format (and correct me if I am wrong). If I explode I will have
> to use the fixed format dd/mm/yyyy and I can't use other input formats
> beside this so I lose this flexible approach.

> It does work for me now but I was wondering if there was a way to avoid
> this.

Not as I know. So, you should either force user to use specific format
(military YYYY-MM-DD HH:MM:SS for example) or leave user no chance to enter
wrong data.

--
Sincerely Yours, ANR Daemon <anrdaemonfreemail.ru>

attached mail follows:


> Greetings, Thodoris.
> In reply to Your message dated Wednesday, October 8, 2008, 16:35:40,
>
>
>

Greetings to you too :-) .
>>> From your function name I assume you want to use it in MySQL. In that
>>> case, why don't you have MySQL do all the magic for you?
>>> eg. INSERT INTO table (col) VALUES (FROM_UNIXTIME($timestamp));
>>> (using FROM_UNIXTIME($timestamp) will give you the date-time in "mysql
>>> format" (YYYY-MM-DD HH:MM:SS) or any other format (if given via the
>>> 2nd parameter)
>>>
>>>
>
>

Well actually the basic question was if there is about how to change the
user input rather then how to retrieve the data.

As for the retrieved data: Those functions belong to framework and by
changing just a function I can retrieve whatever format I need by
changing a function instead of changing all the queries in the project.

So I guess I will stick with that although I am aware of the date-time
functions that mysql has available.

>> Well I have made these two functions to solve this:
>>
>
>
>> function dateMysqlToWeb($mysqldate){
>>
>
>
>> $format = 'd/m/Y';
>> $timestamp = strtotime($mysqldate);
>>
>
>
>> return date($format,$timestamp);
>>
>
>
>> }
>>
>
> Use SQL DATE_FORMAT instead.
> Remember: Request the data you need, not the data stored.
>
>

BTW it was a good suggestion but that is not always true.

>> function dateWebToMysql($webdate){
>>
>
>
>> $format = 'Y-m-d';
>> $date_part = explode("/",$webdate);
>> $timestamp = mktime(0,0,0,$date_part[1],$date_part[0],$date_part[2]);
>>
>
>
>> return date($format,$timestamp);
>>
>
>
>> }
>>
>
>
>> My basic problem was how to make the user input from a form into a
>> timestamp not how to use it with mysql. Since the format used here is
>> dd/mm/yyyy I can't use the strtotime directly bacause as far as I know
>> from the documentation I don't think that it changes with the timezone
>> (as Stut suggested). So since strtotime understands all these variations
>> like:
>>
>
>
>> mm/dd/yyyy, m/d/yy, mm/d/yy etc
>>
>
> Very basic solution: use 3 editboxes and short javascript sample to confirm
> input.
> Like
> [__]/[__]/[____]
> <span id="timeconfirm">...</span>
> And fill 'timeconfirm' in onchange/onkeypress event, using verbal format like
> Tue, Jan 03, 2008
>
> That way, user actually see which date s/he have entered and you may use it
> straightforward.
>

This is possible since strtotime accepts many formats and if one of them
was dd/mm/yyyy it would work like charm.

Nevertheless I made a javascript to chose the date directly from a
window by just clicking it. In addition to that I will have to validate
the form data before the insert no matter what javascript does.
>
>> I can't use this flexible behavior to get the input if it is not in the
>> American format (and correct me if I am wrong). If I explode I will have
>> to use the fixed format dd/mm/yyyy and I can't use other input formats
>> beside this so I lose this flexible approach.
>>
>
>
>> It does work for me now but I was wondering if there was a way to avoid
>> this.
>>
>
> Not as I know. So, you should either force user to use specific format
> (military YYYY-MM-DD HH:MM:SS for example) or leave user no chance to enter
> wrong data.
>
>
>

I am already doing that but it would much more convenient if the format
we usually use here (dd/mm/yyyy) was acceptable depending on the
timezone as Stut suggested somewhere in this thread.

attached mail follows:


What I am trying to do is to
pass an aggregate variable which is the sum of
some smaller variable.

This var also need to finish in the form of $XXXX.YY .

Pointers please.
--
Member - Liberal International
This is doctornl2k.ab.ca Ici doctornl2k.ab.ca
God, Queen and country! Beware Anti-Christ rising! Canada vote anything but
Conservative on 14 OCt 2008, join us at http://www.harpocrit.ca .

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

attached mail follows:


The Doctor wrote:
> What I am trying to do is to
> pass an aggregate variable which is the sum of
> some smaller variable.
>
> This var also need to finish in the form of $XXXX.YY .
>
> Pointers please.

Most of the above can be done using number_format(). The dollar sign you will
have to add yourself.

http://php.net/number_format

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

attached mail follows:


On Fri, Oct 10, 2008 at 1:33 PM, The Doctor <doctordoctor.nl2k.ab.ca> wrote:
> What I am trying to do is to
> pass an aggregate variable which is the sum of
> some smaller variable.
>
> This var also need to finish in the form of $XXXX.YY .
>
> Pointers please.

Would you care to explain a little further what you are trying to do.
I can't tell from your post what you mean by an "aggregate variable"
or the "sum of some smaller variable." What are you passing this
to/from? Are you looking for something like this?

http://www.php.net/manual/en/function.array-sum.php

Andrew

attached mail follows:


Hi all,

I'm wondering why PHP doesn't free my memory with this test code. The
memory usage is always the same even if i unset my object. The Garbage
collector seems to only free the memory at the end of the script.

Here's the php Scripts that i use for testing:

<?php
 //dl("php_mapscript.so");

function test() {
   $oShapeFile = ms_newShapefileObj(
      "/opt/www/bdga/msp/data/bdga/BDGA_HYDRO_S_POLY.shp", -1);
  
   echo "before getShape : ".memory_get_usage(true)."\n";
  
   for ($i=0; $i<$oShapeFile->numshapes;$i++) {
      $oShape = $oShapeFile->getShape($i);
      $oShape->free();
      unset($oShape);
      $oShape = NULL;
   }

echo "after getShape : ".memory_get_usage(true)."\n";
$oShapeFile->free();
unset($oShapeFile);
$oShapeFile = null;

echo "after free : ".memory_get_usage(true)."\n";
 }

echo "start : ".memory_get_usage(true)."\n";
test();
echo "end : ".memory_get_usage(true)."\n";

?>

Output result:
start : 262144
before getShape : 262144
after getShape : 11010048
after free : 11010048
end : 11010048

I've also run valgrind to be sure that is not my extension that doesn't
free its memory:
$ valgrind --leak-check=full php -f shapeTest.php
==18730== LEAK SUMMARY:
==18730== definitely lost: 0 bytes in 0 blocks.
==18730== possibly lost: 0 bytes in 0 blocks.
==18730== still reachable: 240 bytes in 2 blocks.
==18730== suppressed: 0 bytes in 0 blocks.

Thanks,
Alan

--
Alan Boudreault
Mapgears
http://www.mapgears.com

attached mail follows:


Alan Boudreault wrote:
> Hi all,
>
> I'm wondering why PHP doesn't free my memory with this test code. The
> memory usage is always the same even if i unset my object. The Garbage
> collector seems to only free the memory at the end of the script.
>
> Here's the php Scripts that i use for testing:
>
> <?php
> //dl("php_mapscript.so");
>
> function test() {
> $oShapeFile = ms_newShapefileObj(
> "/opt/www/bdga/msp/data/bdga/BDGA_HYDRO_S_POLY.shp", -1);
>
> echo "before getShape : ".memory_get_usage(true)."\n";
>
> for ($i=0; $i<$oShapeFile->numshapes;$i++) {
> $oShape = $oShapeFile->getShape($i);
> $oShape->free();
> unset($oShape);
> $oShape = NULL;
> }
>
> echo "after getShape : ".memory_get_usage(true)."\n";
> $oShapeFile->free();
> unset($oShapeFile);
> $oShapeFile = null;
>
> echo "after free : ".memory_get_usage(true)."\n";
> }
>
> echo "start : ".memory_get_usage(true)."\n";
> test();
> echo "end : ".memory_get_usage(true)."\n";
>
> ?>
>
> Output result:
> start : 262144
> before getShape : 262144
> after getShape : 11010048
> after free : 11010048
> end : 11010048
>
> I've also run valgrind to be sure that is not my extension that doesn't
> free its memory:
> $ valgrind --leak-check=full php -f shapeTest.php
> ==18730== LEAK SUMMARY:
> ==18730== definitely lost: 0 bytes in 0 blocks.
> ==18730== possibly lost: 0 bytes in 0 blocks.
> ==18730== still reachable: 240 bytes in 2 blocks.
> ==18730== suppressed: 0 bytes in 0 blocks.
>
>
> Thanks,
> Alan
>

interesting, I'm finding the same thing in one of my atom feed parsers;
over time no matter how much I unset / truncate variables the memory
usage stills grows over time - at this time I can't find any way to
bring it right down; on a timer the whole script resets and restarts itself;

one thing I have noticed is that I can see the emalloc memory usage
report dropping and rising [memory_get_usage( false );], but still
rising over time..

hope this wasn't a hijack; just here trying to figure out the same
problem at the minute!

Regards..

Nathan

attached mail follows:


On Fri, Oct 10, 2008 at 3:32 PM, Nathan Rixham <nrixhamgmail.com> wrote:
> Alan Boudreault wrote:
>>
>> Hi all,
>>
>> I'm wondering why PHP doesn't free my memory with this test code. The
>> memory usage is always the same even if i unset my object. The Garbage
>> collector seems to only free the memory at the end of the script.
>>
>> Here's the php Scripts that i use for testing:
>>
>> <?php
>> //dl("php_mapscript.so");
>>
>> function test() {
>> $oShapeFile = ms_newShapefileObj(
>> "/opt/www/bdga/msp/data/bdga/BDGA_HYDRO_S_POLY.shp", -1);
>> echo "before getShape : ".memory_get_usage(true)."\n";
>> for ($i=0; $i<$oShapeFile->numshapes;$i++) {
>> $oShape = $oShapeFile->getShape($i);
>> $oShape->free();
>> unset($oShape);
>> $oShape = NULL;
>> }
>>
>> echo "after getShape : ".memory_get_usage(true)."\n";
>> $oShapeFile->free();
>> unset($oShapeFile);
>> $oShapeFile = null;
>>
>> echo "after free : ".memory_get_usage(true)."\n";
>> }
>>
>> echo "start : ".memory_get_usage(true)."\n";
>> test();
>> echo "end : ".memory_get_usage(true)."\n";
>>
>> ?>
>>
>> Output result:
>> start : 262144
>> before getShape : 262144
>> after getShape : 11010048
>> after free : 11010048
>> end : 11010048
>>
>> I've also run valgrind to be sure that is not my extension that doesn't
>> free its memory:
>> $ valgrind --leak-check=full php -f shapeTest.php
>> ==18730== LEAK SUMMARY:
>> ==18730== definitely lost: 0 bytes in 0 blocks.
>> ==18730== possibly lost: 0 bytes in 0 blocks.
>> ==18730== still reachable: 240 bytes in 2 blocks.
>> ==18730== suppressed: 0 bytes in 0 blocks.
>>
>>
>> Thanks,
>> Alan
>>
>
> interesting, I'm finding the same thing in one of my atom feed parsers; over
> time no matter how much I unset / truncate variables the memory usage stills
> grows over time - at this time I can't find any way to bring it right down;
> on a timer the whole script resets and restarts itself;
>
> one thing I have noticed is that I can see the emalloc memory usage report
> dropping and rising [memory_get_usage( false );], but still rising over
> time..
>
> hope this wasn't a hijack; just here trying to figure out the same problem
> at the minute!
>
> Regards..
>
> Nathan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I think the engine doesn't really worry about freeing memory until it
has to. Or was this only on circular references? I remember there
was that whole GSOC project to implement garbage collection, but it
never got implemented. Maybe someone who really knows will chime in.

attached mail follows:


Eric Butera wrote:
> On Fri, Oct 10, 2008 at 3:32 PM, Nathan Rixham <nrixhamgmail.com> wrote:
>> Alan Boudreault wrote:
>>> Hi all,
>>>
>>> I'm wondering why PHP doesn't free my memory with this test code. The
>>> memory usage is always the same even if i unset my object. The Garbage
>>> collector seems to only free the memory at the end of the script.
>>>
>>> Here's the php Scripts that i use for testing:
>>>
>>> <?php
>>> //dl("php_mapscript.so");
>>>
>>> function test() {
>>> $oShapeFile = ms_newShapefileObj(
>>> "/opt/www/bdga/msp/data/bdga/BDGA_HYDRO_S_POLY.shp", -1);
>>> echo "before getShape : ".memory_get_usage(true)."\n";
>>> for ($i=0; $i<$oShapeFile->numshapes;$i++) {
>>> $oShape = $oShapeFile->getShape($i);
>>> $oShape->free();
>>> unset($oShape);
>>> $oShape = NULL;
>>> }
>>>
>>> echo "after getShape : ".memory_get_usage(true)."\n";
>>> $oShapeFile->free();
>>> unset($oShapeFile);
>>> $oShapeFile = null;
>>>
>>> echo "after free : ".memory_get_usage(true)."\n";
>>> }
>>>
>>> echo "start : ".memory_get_usage(true)."\n";
>>> test();
>>> echo "end : ".memory_get_usage(true)."\n";
>>>
>>> ?>
>>>
>>> Output result:
>>> start : 262144
>>> before getShape : 262144
>>> after getShape : 11010048
>>> after free : 11010048
>>> end : 11010048
>>>
>>> I've also run valgrind to be sure that is not my extension that doesn't
>>> free its memory:
>>> $ valgrind --leak-check=full php -f shapeTest.php
>>> ==18730== LEAK SUMMARY:
>>> ==18730== definitely lost: 0 bytes in 0 blocks.
>>> ==18730== possibly lost: 0 bytes in 0 blocks.
>>> ==18730== still reachable: 240 bytes in 2 blocks.
>>> ==18730== suppressed: 0 bytes in 0 blocks.
>>>
>>>
>>> Thanks,
>>> Alan
>>>
>> interesting, I'm finding the same thing in one of my atom feed parsers; over
>> time no matter how much I unset / truncate variables the memory usage stills
>> grows over time - at this time I can't find any way to bring it right down;
>> on a timer the whole script resets and restarts itself;
>>
>> one thing I have noticed is that I can see the emalloc memory usage report
>> dropping and rising [memory_get_usage( false );], but still rising over
>> time..
>>
>> hope this wasn't a hijack; just here trying to figure out the same problem
>> at the minute!
>>
>> Regards..
>>
>> Nathan
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> I think the engine doesn't really worry about freeing memory until it
> has to. Or was this only on circular references? I remember there
> was that whole GSOC project to implement garbage collection, but it
> never got implemented. Maybe someone who really knows will chime in.

you're right; I remember the discussion over on internals 3rd December
last year; they made a new gc patch for 5.3; not sure if it got
implemented or not..

here's what andy wrote (there followed a massive discussion)

[quote]
Hi all,

Was hoping to send this off earlier but I was travelling for the past
week and had very limited email access.

As promised in the past few weeks we have spent a significant amount of
time in reviewing the garbage collector work and testing it in our
performance lab. Dmitry has been exchanging ideas and patches with David
Wang during this time. Suffice to say that as I've mentioned in the
past, memory management is an extremely sensitive piece of PHP, which is
why it was important for us to review this work in great depth before
committing it to the code base.

The updated patch still retains the same algorithm as David's original
implementation however the data structures have been changed in order to
work faster and use less memory.

The revised patch has the following advantages:
- It fixes several crash bugs

- Enhances performance by removing several unnecessary checks
- The memory overhead was reduced (from 12 to 4 bytes for each
heap-allocated zval)
- The speed of "clean" PHP code (code that doesn't create cycles) was
improved
  - Additional test cases were created

The end result is a more stable and faster GC patch. That said we have
yet to find real-life applications that create significant cycles which
would benefit from this patch. In fact as you'll see from the results
our tests show an increase in maximum memory use and slower execution
(to be fair they are marginal).

We have tested both PHP_5_3 without any patches, the original patch and
the new patch.

The following table shows execution time (seconds for N requests) and
slowdown.

        PHP_5_3

Original GC patch

Current GC patch

        

slowdown

slowdown

bench

11,550

12,310

6,58%

12,170

5,37%

hello

8,781

8,852

0,81%

8,813

0,36%

xoops

128,500

135,100

5,14%

130,200

1,32%

static

18,540

20,840

12,41%

18,920

2,05%

qdig

29,320

30,270

3,24%

29,610

0,99%

qdig2

13,960

14,100

1,00%

14,090

0,93%

The next table shows memory usage in MB and overhead

        PHP_5_3

Original GC patch

Current GC patch

        

overhead

overhead

hello

13,750

13,945

1,42%

13,765

0,11%

xoops

18,036

18,636

3,33%

18,568

2,95%

static

15,300

16,000

4,58%

15,308

0,05%

qdig

14,820

15,008

1,27%

14,828

0,05%

qdig2

14,824

15,012

1,27%

14,838

0,09%

To summarize the patch lead to approx. 5% slowdown and 3% memory
overhead for typical applications (as always, you mileage may vary
depending on your system's architecture and OS although my guesstimate
is that you will see even worse results in a 64bit environment). We also
tested SugarCRM to get another sanity for these results and we got
similar results.

I am not quite sure where this leaves us with this patch. On one hand I
think now the effort has been made it's a good thing to offer it as part
of PHP. The downside is of course some performance degradation and
possible instabilities as this patch continues to stabilize (it took
about two releases for us to stabilize the Zend Memory Manager even
after in-depth testing due to edge cases in allocation patterns and
various extensions, etc...).I'd be surprised if our team has found all
possible bugs.

Personally I think the decision should be either in or out. Adding this
as a compile option is not a good idea as it would create binary
compatibility issues and would be a pain for the community. I think my
inclination is to commit the patch, not have it #ifdef'ed but always
compiled but to have the garbage collection itself turned off by default
(mainly for stability reasons. Note: the increased memory footprint and
performance loss also exists with the collection itself turned off). We
can turn it on when we're in dev for snapshots so that we iron out bugs.
That said, as you can see from the results most people and real-life
applications will be worse off than today.

Thanks to David & Dmitry for working hard on this (and everyone else who
contributed).

The stage is open for ideas/thoughts/suggestions J

Andi
[/quote]

attached mail follows:


Am I allowed to post job opportunities on here? I see them sometimes. I'm
not sure if its against the General Mailing List rules or not.

--
Kyle Terry | www.kyleterry.com

attached mail follows:


On Fri, Oct 10, 2008 at 4:44 PM, Kyle Terry <kylekyleterry.com> wrote:
> Am I allowed to post job opportunities on here? I see them sometimes. I'm
> not sure if its against the General Mailing List rules or not.

    You'll get mixed results on that here, Kyle. For the most part,
those who matter won't have a problem with it as long as it's a
legitimate one-time thing (not trying to use this list as a
recruitment tool), respectful, and not a SPAM-vertisement.

--
</Daniel P. Brown>
More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

attached mail follows:


> -----Original Message-----
> From: tedd [mailto:tedd.sperlinggmail.com]
> Sent: Friday, October 10, 2008 1:54 PM
> To: php-generallists.php.net
> Subject: RE: [PHP] [Semi-OT] Tonns of jobs available
>
> Actually, if I really punched a time clock, I'm probably making
> around $25 per hour (or less) anyway. It's a good thing I love the
> work, but it's usually the clients who are the main problem. Too bad
> they often stand in the way of what they really want done.

Yep, I think you hit the nail on the head with that last observation. If
it weren't for the client themselves, I'd usually be able to get what
they need done a lot more efficiently. :D

Todd Boyd
Web Programmer

attached mail follows:


At 3:48 PM -0500 10/10/08, Boyd, Todd M. wrote:
> > -----Original Message-----
>> From: tedd [mailto:tedd.sperlinggmail.com]
>> Sent: Friday, October 10, 2008 1:54 PM
>> To: php-generallists.php.net
>> Subject: RE: [PHP] [Semi-OT] Tonns of jobs available
>>
>> Actually, if I really punched a time clock, I'm probably making
>> around $25 per hour (or less) anyway. It's a good thing I love the
>> work, but it's usually the clients who are the main problem. Too bad
>> they often stand in the way of what they really want done.
>
>Yep, I think you hit the nail on the head with that last observation. If
>it weren't for the client themselves, I'd usually be able to get what
>they need done a lot more efficiently. :D
>
>
>Todd Boyd
>Web Programmer

I posted this on my web site and have sent a couple of clients there.

http://sperling.com/four-things-clients-should-know.php

I don't know if they will understand it, but it'll give them
something wonder about.

Cheers,

tedd

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

attached mail follows:


Hi forum

I install library GD in Centos with

yum install php-gd

I follow your instructions and install,
but when i execute phpinfo( ),  i see the next

'./configure' '--build=i686-redhat-linux-gnu' '..... without-gdbm'
'--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr'
'--with-png' '--without-gd' .......

and 

gd

    
        
            GD Support
            enabled
        
        
            GD Version
            bundled (2.0.28 compatible)
        
        
            FreeType Support
            enabled
        
        
            FreeType Linkage
            with freetype
        
        
            FreeType Version
            2.2.1
        
        
            GIF Read Support
            enabled
        
        
            GIF Create Support
            enabled
        
        
            JPG Support
            enabled
        
        
            PNG Support
            enabled
        
        
            WBMP Support
            enabled
        
        
            XBM Support
            enabled
        
    

But don't work with instructions of this library 
.

And in other server install XAMPP and work very good the same
code, but need work in first server. 

And other server the
result phpinfo ( ) is

 --with-gdbm=/opt/lampp
--with-jpeg-dir=/opt/lampp --with-png-dir=/opt/lampp
--with-freetype-dir=/opt/lampp  --with-gd

I think when
re-compile the php don't suport instruction --with-gd 

You
can help me please.

Thanks.

attached mail follows:


Hi, I was wondering,
By php.net manual, "Please note that variable variables cannot be used with
PHP's Superglobal arrays within functions or class methods". Is there any
way to override this problem? Just the not nice eval("return $variable");?

and in simple words - is there any way to make the following code work:

$varname = "\$_SERVER['REMOTE_ADDR']";
$varvalue = $$varname;

?