php-general Digest 1 Sep 2008 13:56:08 - Issue 5657
Topics (messages 279185 through 279216):
[HS] Howto answer Was: [PHP] casting static property
279185 by: Lupus Michaelis
Re: ASCII Captcha
279186 by: Ross McKay
279204 by: Nisse Engström
279206 by: Nisse
Jochem Maas wrote:
redirecting to generals mailing list ...
Diogo Neves schreef:
php -r 'class B { private static function a() {} public function
__callStatic($method, $parms) { echo $method, \n; } } $a = new B;
$a::a();'
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in
Robert Cummings wrote:
#!/bin/sh
while true
do
yourscript
sleep 300
done
I accomplish the same with cron scripts by using locks with expiry.
got an example? my cat skinning skills need to be improved, the cat
won't like it but screw the cat, right?
[snip code]
I
Per Jessen schreef:
Robert Cummings wrote:
#!/bin/sh
while true
do
yourscript
sleep 300
done
I accomplish the same with cron scripts by using locks with expiry.
got an example? my cat skinning skills need to be improved, the cat
won't like it but screw the cat, right?
[snip code]
I
Jochem Maas wrote:
either way, I've just learn't something new as far as shellscripting
goes :-)
apart from the xargs command ... that still does my head in (don't worry
I'll look it up ... for the umpteenth time).
find $lockfile -cmin +60 | xargs rm
FWIW, it's nicer to do:
$ find $lockfine
Hello early birds,
I am going round and round the docs and list posts I saved on this
topic... but I am still stumped.
Kindly show me what I am missing. I want to simply send an array of
vars via a post form to my receiving script.
I've got simple inputs like this:
input
Colin Guthrie wrote:
Jochem Maas wrote:
either way, I've just learn't something new as far as shellscripting
goes :-)
apart from the xargs command ... that still does my head in (don't
worry I'll look it up ... for the umpteenth time).
find $lockfile -cmin +60 | xargs rm
FWIW, it's
Jochem Maas wrote:
lockfile=/var/lock//file
# clear out a lock older than 60mins
find $lockfile -cmin +60 | xargs rm
test ! -f $lockfile (
touch $lockfile
run some php
rm -f $lockfile
)
wouldn't creating a dir be better here? (with regard to atomicity)
I haven't thought it
Colin Guthrie schreef:
Jochem Maas wrote:
either way, I've just learn't something new as far as shellscripting
goes :-)
apart from the xargs command ... that still does my head in (don't worry
I'll look it up ... for the umpteenth time).
find $lockfile -cmin +60 | xargs rm
FWIW, it's nicer
Hi,
On Mon, Sep 1, 2008 at 9:25 AM, Govinda [EMAIL PROTECTED] wrote:
Hello early birds,
I am going round and round the docs and list posts I saved on this topic...
but I am still stumped.
Kindly show me what I am missing. I want to simply send an array of vars
via a post form to my
Hi All,
For security purposes I would like to upload a file outside the webroot.
I have got this to work on my local dev machine but it doesn't seem to work
on the live server.
I have tried both the relative path and also the full path (from the
$_SERVER[DOCUMENT_ROOT] variable).
Now I can't
On Fri, 29 Aug 2008 16:11:01 -0400, tedd wrote:
http://webbytedd.com/aa/assorted-captcha/
Some of these are really cool. Assuming they are
actually working, that is...
Graphic CAPTCHA:
Error!
Reload the page!
Audio CAPTCHA:
--
There is nothing to
On Mon, 1 Sep 2008 11:14:39 +0200, Nisse Engström wrote:
On Fri, 29 Aug 2008 16:11:01 -0400, tedd wrote:
http://webbytedd.com/aa/assorted-captcha/
Performance CAPTCHA:
This one actually works. Well, sort of...
And maybe your code should check for a circle rather
Govinda wrote:
Hello early birds,
I am going round and round the docs and list posts I saved on this
topic... but I am still stumped.
Kindly show me what I am missing. I want to simply send an array of
vars via a post form to my receiving script.
I've got simple inputs like this:
Govinda schrieb:
Hello early birds,
I am going round and round the docs and list posts I saved on this
topic... but I am still stumped.
Kindly show me what I am missing. I want to simply send an array of
vars via a post form to my receiving script.
I've got simple inputs like this:
input
Hi,
Is it possible to have shared memory in the form of shared global variables
in PHP? Or any other form of shared memory? And if that is the case, is
there any form of mutex functionality which may be used to assure
syncronized access to this memory?
My next question is related to the first
Angelo Zanetti schrieb:
Hi All,
For security purposes I would like to upload a file outside the webroot.
I have got this to work on my local dev machine but it doesn't seem to work
on the live server.
I have tried both the relative path and also the full path (from the
2008/8/30 Per Jessen [EMAIL PROTECTED]:
tedd wrote:
What some browser developers did was to NOT make the conversion from
PUNYCODE to the correct code-points but rather show the PUNYCODE
as-is, which was never the intent of the IDNS WG. This act defeated
the entire process of allowing
Dear all,
We have an immediate job opening available to work in our team of
bio-informaticians on extending the LOVD software (www.LOVD.nl). Even if
you're still a beginner with PHP you're welcome to respond. Affinity to
biology is a big plus.
LOVD (Leiden Open Variation Database) is webbased
Per Jessen schrieb:
Jochem Maas wrote:
lockfile=/var/lock//file
# clear out a lock older than 60mins
find $lockfile -cmin +60 | xargs rm
test ! -f $lockfile (
touch $lockfile
run some php
rm -f $lockfile
)
wouldn't creating a dir be better here? (with regard to atomicity)
I haven't
Per Jessen schreef:
Jochem Maas wrote:
lockfile=/var/lock//file
# clear out a lock older than 60mins
find $lockfile -cmin +60 | xargs rm
test ! -f $lockfile (
touch $lockfile
run some php
rm -f $lockfile
)
wouldn't creating a dir be better here? (with regard to atomicity)
I haven't
Jochem Maas wrote:
Per Jessen schreef:
Jochem Maas wrote:
lockfile=/var/lock//file
# clear out a lock older than 60mins
find $lockfile -cmin +60 | xargs rm
test ! -f $lockfile (
touch $lockfile
run some php
rm -f $lockfile
)
wouldn't creating a dir be better here? (with regard
Thanks Eric, Diogo, Ross and specially Christopher for this long article.
I have started reading those articles.
And I hope to collect those books too.
--
Blog: http://talk.cmyweb.net/
Follow me: http://twitter.com/shiplu
Thanks Diogo! , and other who replied!
You nailed it (Of course! you would say.)
I didn't reply sooner as we had a power out (just enough to get me to
go to bed already ;-)
-G
On Sep 1, 2008, at 2:31 AM, Diogo Neves wrote:
foreach($_POST['$tmbsToiterate'] as $value) {
Hi Shiplu,
For all that you mentioned, and if you want to get a quite good suggestion,
I will highly recommend that you read through McConnell's Code Complete (2nd
Edition).
Specifically:
Chapter 31: Layout and Style
Chapter 32: Self-Documenting Code (Commenting Techniques)
It won't disappoint
Has anyone tried to work this out?
All I'm trying to get is the rough distance in miles between two UK
postcodes using Google Maps API for a basic auto quote script based on
mileage travelled.
I thought it would be easy but it seems that I need to convert each postcode
to Lat/Long using Geocoding
Tom Chubb wrote:
I thought it would be easy but it seems that I need to convert each postcode
to Lat/Long using Geocoding and then work it out from there.
That's the best way: then just do something like:
Here's how I do it in SQL, but the principle is the same in PHP, so I'm
sure you'll be
Has anyone tried to work this out?
All I'm trying to get is the rough distance in miles between two UK
postcodes using Google Maps API for a basic auto quote script based on
mileage travelled.
I thought it would be easy but it seems that I need to convert each postcode
to Lat/Long using
On 01/09/2008, Colin Guthrie [EMAIL PROTECTED] wrote:
Tom Chubb wrote:
I thought it would be easy but it seems that I need to convert each
postcode
to Lat/Long using Geocoding and then work it out from there.
That's the best way: then just do something like:
Here's how I do it in SQL,
2008/9/1 Tom Chubb [EMAIL PROTECTED]
On 01/09/2008, Colin Guthrie [EMAIL PROTECTED] wrote:
Tom Chubb wrote:
I thought it would be easy but it seems that I need to convert each
postcode
to Lat/Long using Geocoding and then work it out from there.
That's the best way: then just
This is what I have:
$distance = number_format(ceil(69*rad2deg(acos(sin(deg2rad($ulat)) *
sin(deg2rad($vlat)) + cos(deg2rad($ulat)) * cos(deg2rad($vlat)) *
cos(deg2rad($ulong - $vlong));
where:
$ulat = latitude of user #1
$ulong = longitude of user #1
$vlat = latitude of user #2
$vlong =
Tom Chubb wrote:
That's all way above my head, but I think I'll be able to understand it
after a strong coffee!
I should point out that this is really just trig and is only an
approximate distance as the crow flies. Not even sure if it takes the
curvature of the earth into consideration, but
On 01/09/2008, Michal Sokolowski [EMAIL PROTECTED] wrote:
2008/9/1 Tom Chubb [EMAIL PROTECTED]
On 01/09/2008, Colin Guthrie [EMAIL PROTECTED] wrote:
Tom Chubb wrote:
I thought it would be easy but it seems that I need to convert each
postcode
to Lat/Long using Geocoding and then
On Mon, 2008-09-01 at 09:44 +0200, Per Jessen wrote:
Robert Cummings wrote:
#!/bin/sh
while true
do
yourscript
sleep 300
done
I accomplish the same with cron scripts by using locks with expiry.
got an example? my cat skinning skills need to be improved, the
On Mon, 2008-09-01 at 14:34 +0200, Merlin Morgenstern wrote:
Per Jessen schrieb:
Jochem Maas wrote:
lockfile=/var/lock//file
# clear out a lock older than 60mins
find $lockfile -cmin +60 | xargs rm
test ! -f $lockfile (
touch $lockfile
run some php
rm -f $lockfile
)
On Mon, 2008-09-01 at 14:51 +0200, Per Jessen wrote:
Jochem Maas wrote:
Per Jessen schreef:
Jochem Maas wrote:
lockfile=/var/lock//file
# clear out a lock older than 60mins
find $lockfile -cmin +60 | xargs rm
test ! -f $lockfile (
touch $lockfile
run some php
rm -f
Ross McKay [EMAIL PROTECTED] wrote:
Find out what bad is by reading this:
http://thedailywtf.com/Series/CodeSOD.aspx
Then, don't do it like that!
What I enjoyed most on that page was this comment:
One day, after a code review by one of our 'senior' developers this little
beauty showed
Robert Cummings wrote:
I'm probably old fashioned, but to me all that stuff is way overkill.
I also tend to think that synchronizing scripts is a job for the
shell, not PHP.
lockfile=/var/lock//file
# clear out a lock older than 60mins
find $lockfile -cmin +60 | xargs rm
test ! -f
Robert Cummings wrote:
The return value of creating the directory is either true for it
having been made or false for it having not been made. Therein lies
the atomicity. The OS will not return success if it was not made and
will not return failure if it was made.
Ah, interesting. Thanks.
Kent Larsson wrote:
Hi,
Is it possible to have shared memory in the form of shared global
variables in PHP? Or any other form of shared memory? And if that is
the case, is there any form of mutex functionality which may be used
to assure syncronized access to this memory?
My next
On Mon, 2008-09-01 at 20:22 +0200, Per Jessen wrote:
Robert Cummings wrote:
I'm probably old fashioned, but to me all that stuff is way overkill.
I also tend to think that synchronizing scripts is a job for the
shell, not PHP.
lockfile=/var/lock//file
# clear out a lock older
Robin Vickery wrote:
Firefox holds a whitelist of toplevel domains that are allowed to
display unicode (to see the list go to about:config and enter
IDN.whitelist into the filter box).
It does not allow .com domains to contain unicode for obvious phishing
reasons,
Very interesting, I had
Hi,
Thank you for your answer. I was hoping there were a solution. :-/ It would
have been nice as PHP has a large install base and is a quite common element
in cheap web hosting solutions. Has anyone else got any more comments or
suggestions?
In absence of shared memory and threads. What I
Hello,
on 09/01/2008 09:15 AM Ivo F.A.C. Fokkema said the following:
Dear all,
We have an immediate job opening available to work in our team of
bio-informaticians on extending the LOVD software (www.LOVD.nl). Even if
you're still a beginner with PHP you're welcome to respond. Affinity to
On Mon, 1 Sep 2008 08:50:45 -0700 (PDT), larry wrote:
Write a lot of code, rewrite code you think is messy (we can always do
better).
The more you do the better you should get.
Here is some inspiration on that:
http://www.codinghorror.com/blog/archives/001160.html
NB: the message of that blog
On Mon, Sep 1, 2008 at 5:45 PM, Kent Larsson [EMAIL PROTECTED] wrote:
Hi,
Thank you for your answer. I was hoping there were a solution. :-/ It would
have been nice as PHP has a large install base and is a quite common element
in cheap web hosting solutions. Has anyone else got any more
Robert Cummings a écrit :
Try running that on windows.
No problem
http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Kent Larsson wrote:
Hi,
Is it possible to have shared memory in the form of shared global variables
in PHP? Or any other form of shared memory? And if that is the case, is
there any form of mutex functionality which may be used to assure
syncronized access to this memory?
My next question is
Just a quick Q, which I know has to be in the docs somewhere, but I
haven't come across it yet-
PHP automatically escaping single and double quotes... how to turn it
off?
I.e.-
in a form text input, someone inputs
love's influence grows
and on the posted page I get:
love\'s \influence\
On Mon, Sep 1, 2008 at 10:21 PM, Govinda [EMAIL PROTECTED] wrote:
Just a quick Q, which I know has to be in the docs somewhere, but I haven't
come across it yet-
PHP automatically escaping single and double quotes... how to turn it off?
I.e.-
in a form text input, someone inputs
love's
http://us2.php.net/apc
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Kent Larsson wrote:
Hi,
Is it possible to have shared memory in the form of shared global variables
in PHP? Or any other form of shared memory? And if that is the case, is
there any
PHP List,
I have a script, part of which is taken from a script I found on the
'net, which tries to detect the user agent of the browser accessing the
site. One of the reasons I'm doing this is to find out if the browser is
a desktop or mobile.
Part of the code looks like this:
$ua =
Kent Larsson wrote:
In absence of shared memory and threads. What I really must have is
some kind of mutex functionality. I will be manipulating files on disk
and I don't want two instances to be able to touch the disk at the
same time.
Touch the disk or touch the file? I assume you meant
Lupus Michaelis wrote:
Robert Cummings a écrit :
Try running that on windows.
No problem
http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx
And of course, there's also Cygwin.
/Per Jessen, Zürich
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
54 matches
Mail list logo