|
|
|
|
Re: Correlating curl resources to some other object. [message #185108 is a reply to message #185104] |
Wed, 26 February 2014 16:25 |
Adam Harvey
Messages: 25 Registered: September 2010
Karma: 0
|
Junior Member |
add to buddy list ignore all messages by this user
|
|
On Wed, 26 Feb 2014 13:52:10 -0500, Jerry Stuckle wrote:
> On 2/26/2014 12:52 PM, Daniel Pitts wrote:
>> On 2/26/14 9:07 AM, Jerry Stuckle wrote:
>>> I don't think there is a guarantee that casting a resource to a string
>>> results in a unique string (although it does seem to work this way
>>> currently).
>> The documentation *does* say it is a unique string.
>>
>> 'Resources are always converted to strings with the structure "Resource
>> id #1", where 1 is the unique number assigned to the resource by PHP at
>> runtime'
>>
>>
> That could be read two ways. For instance, if a resource is destroyed,
> creating a new resource could have the same number. It would still
> identify a unique *valid* resource.
To be clear: resource numbers aren't reused within an individual request.
(At present, they always increase sequentially -- I don't see that
changing, but also wouldn't want to guarantee it.)
>> Of course, it then says don't rely on that structure. Grr.
>>
>>
> Yes, as I said, I agree it seems to always be a unique value (it
> increments one for each resource created). But nothing says it will
> remain so, and the doc seems to indicate the opposite.
>
> Of course, it could also mean don't rely in it being exactly "Resource
> id #1" - but later could be something like "curl resource #1", "mysql
> resource #2", or even just "curl 1" - but still unique.
That's the intention. I agree it was poorly worded.
> The doc is not
> at all clear on this. I would like to see a clarification on this
> point, for just the reasons you've stated.
I've committed an update to the manual to clarify this. The new wording
(which will appear over the weekend, assuming no issues with the
documentation build on Friday) is:
Resources are always converted to strings with the structure "Resource id
#1", where 1 is the resource number assigned to the resource by PHP at
runtime. While the exact structure of this string should not be relied on
and is subject to change, it will always be unique for a given resource
within the lifetime of a script being executed (ie a Web request or CLI
process) and won't be reused. To get a resource's type, use the
get_resource_type() function.
>> I wonder if a feature request to support an "spl_resource_hash" would
>> get any traction.
>>
> I would support some kind of truly unique identifier which could be used
> as a key. Whether it is an spl_resource_hash or something else makes
> little difference, as long as it's useful.
As noted above, the intention is that casting a resource to a string
should result in a unique identifier, so a function is unnecessary in
this case.
Adam
|
|
|
|
|
OT: getting older/wiser [message #185119 is a reply to message #185104] |
Thu, 27 February 2014 07:04 |
bill
Messages: 310 Registered: October 2010
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
On 2/26/2014 1:52 PM, Jerry Stuckle wrote:
> If it does, log an error. Be sure to comment your code well so
> if you get the error 2 years from now you know what it means
> (it's amazing how short our memories can be! :) ).
that's because: "(I've probably been in the industry longer than
you've been alive ;)"
Recent research indicates that the reason older folk think
"slower" is that they have more memories to go through to find
what they are looking for (tested with word finding).
It is reasonable to conclude that older = wiser, not slower.
OTOH, I wonder if all the brain space I used for comics and
science fiction (that I still remember) was a good brain space
investment ?
bill
|
|
|
|
Re: OT: getting older/wiser [message #185122 is a reply to message #185120] |
Thu, 27 February 2014 11:02 |
bill
Messages: 310 Registered: October 2010
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
> Yes, but that research is controversial and has not been
> validated by peer review yet. Possibly in the future it will be,
> but until it is, it is only a theory. Remember cold fusion?
If I say "yes," that means I am one of the old/wise.
If I say "no," then I am either one of the old/wise/demented or
too young to remember.
I will say yes and still hope it will work someday.
>
>> OTOH, I wonder if all the brain space I used for comics and
>> science
>> fiction (that I still remember) was a good brain space
>> investment ?
>>
>> bill
>
> Of course it is! Entertainment is an important part of life.
That is one of the reasons I participate here.
|
|
|
|
Re: OT: getting older/wiser [message #185126 is a reply to message #185123] |
Thu, 27 February 2014 12:52 |
|
Daniel Pitts wrote:
> On 2/27/14 5:22 AM, Jerry Stuckle wrote:
>> On 2/27/2014 7:04 AM, bill wrote:
>>> On 2/26/2014 1:52 PM, Jerry Stuckle wrote:
>>> Recent research indicates that the reason older folk think "slower" is
>>> that they have more memories to go through to find what they are looking
>>> for (tested with word finding).
>>> It is reasonable to conclude that older = wiser, not slower.
> […]
>> Yes, but that research is controversial and has not been validated by
>> peer review yet. Possibly in the future it will be, but until it is, it
>> is only a theory. Remember cold fusion?
> You clearly mean hypothesis. Theory is once its proven.
A fundamental, but common, misconception in both statements; in part
purported by some scientists employing informal language (non-scientists
doubly so). Theories are just elaborate(d) thought processes, based on a
number of theses; they can only be either confirmed or falsified (by
reality, e.g. experiment). (The more a theory is confirmed, the firmer it
is believed to be true. And if something passes peer review it just means
that the people who reviewed it have found *nothing* logically *wrong* with
it; it does _not_ mean that the conclusions therein are true.)
For example, Einstein's general theory of relativity – which BTW grows 100
years in two years from now – has not been proven at all and will never be
proven; science just does not work that way. We only assume that the
assumptions he made are true because what follows from them explains our
observations so well. Likewise for Quantum Field Theory and all other
theories.
HTH
PointedEars
--
When all you know is jQuery, every problem looks $(olvable).
|
|
|
Re: OT: getting older/wiser [message #185127 is a reply to message #185120] |
Thu, 27 February 2014 13:01 |
Tim Streater
Messages: 328 Registered: September 2010
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
In article <lene5o$3og$1(at)dont-email(dot)me>, Jerry Stuckle
<jstucklex(at)attglobal(dot)net> wrote:
> On 2/27/2014 7:04 AM, bill wrote:
>> Recent research indicates that the reason older folk think "slower" is
>> that they have more memories to go through to find what they are looking
>> for (tested with word finding).
>> It is reasonable to conclude that older = wiser, not slower.
> Yes, but that research is controversial and has not been validated by
> peer review yet. Possibly in the future it will be, but until it is, it
> is only a theory. Remember cold fusion?
You mean it's only a hypothesis. Cold Fusion never advanced to being a
theory, because it was never validated by experiments carried out by
others. And the purpose of peer review is to critique your experiment
which has led you to make a claim and advance a hypothesis. Your peers
might then say f'rinstance that your methodology is bad, your analysis
is bad, and so on.
--
"People don't buy Microsoft for quality, they buy it for compatibility
with what Bob in accounting bought last year. Trace it back - they buy
Microsoft because the IBM Selectric didn't suck much" - P Seebach, afc
|
|
|
|
|
|
Re: OT: getting older/wiser [message #185139 is a reply to message #185138] |
Sat, 01 March 2014 08:37 |
Colin Birch
Messages: 3 Registered: December 2013
Karma: 0
|
Junior Member |
add to buddy list ignore all messages by this user
|
|
On Fri, 28 Feb 2014 19:08:44 -0800, Daniel Pitts wrote:
> On 2/27/14 3:56 PM, Allodoxaphobia wrote:
>> On Thu, 27 Feb 2014 09:11:38 -0800, Daniel Pitts wrote:
>>>> >
>>>> > It is reasonable to conclude that older = wiser, not slower.
>>>
>>> Stupid people get old too ;-)
>>
>> Nice observation!
>>
>> Alas, there is one creature on this planet to which
>> natural selection seems not to apply.
> Sure it does. Intelligence isn't necessary for surviving. The most
> abundant species are not self-aware
Do you mean women? ;-)
--
Colin Birch
http://www.railscans.co.uk
|
|
|
|