Re: [PHP] 95th percentile of an array.

2011-01-30 Thread Marc Trudel
Just out of curiosity, wouldnt it be better to use floor($n) instead of
round($n-0.5)?

On Sun, Jan 30, 2011 at 5:48 AM, Paul Halliday paul.halli...@gmail.comwrote:

 On Sat, Jan 29, 2011 at 2:28 PM, Adam Richardson simples...@gmail.com
 wrote:
  For the nearest rank computation, you could use the following:
 
  $arr =
 
 array(12,89,65,23,90,99,9,15,56,67,3,52,78,12,10,88,77,77,77,77,77,77,77);
  sort($arr);
  $score_representing_95th_percentile = $arr[round((95/100) * count($arr) -
  .5)];
  echo $score_representing_95th_percentile; // 90
 

 Perfect, exactly what I was looking for.

 thank you.

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




-- 
Marc Trudel-Bélisle
*Chief Technical Officer*
www.wizcorp.jp


Re: [PHP] Mail Function In PHP

2010-03-08 Thread Marc Trudel
If you control your DNS server setup and such, DKIM and authentication
technologies alikes (http://en.wikipedia.org/wiki/DomainKeys) are the way to
go.

Also, make sure the reverse DNS lookup is pointing to the right place, i.e.
that the SMTP server domain name translates to an IP that translates back to
the same domain name when you do a reverse lookup.

Since this is really something more of a network arch. setup, you probably
will find more answers for that on ServerFault or the likes.

MT

On Tue, Mar 9, 2010 at 2:18 AM, Ashley Sheridan 
a...@ashleysheridan.co.ukwrote:

 On Mon, 2010-03-08 at 17:18 +, Richard Quadling wrote:

  On 8 March 2010 13:06, Teus Benschop teusjanne...@gmail.com wrote:
   On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote:
   Contrary to popular belief, to send an email you do not need to have
   your own SMTP server. All you need to know is the SMTP server
   responsible for your recipients email.
   [...]
  
   While the above is true, there is also another thing that comes into
   play. We used to send email directly to the receiver the way described
   above. But at times it happens that the receiving smtp server refuses
 to
   accept mail from the sender since the sender is not known to be a good
   smtp server, and at times it could get blacklisted. Rules like this get
   tightened up because of the desire to curb spam at the source.
  
   Teus.
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
  So, say I did go and setup a local SMTP relay, how would I make it
  known that it was a real smtp server and not just some script
  pushing spam?
 
 
 
  --
  -
  Richard Quadling
  Standing on the shoulders of some very clever giants!
  EE : http://www.experts-exchange.com/M_248814.html
  EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
  Zend Certified Engineer :
 http://zend.com/zce.php?c=ZEND002498r=213474731
  ZOPA : http://uk.zopa.com/member/RQuadling
 


 By having your local relay talk seductively to the remote server?

 More sensibly though, I would assume that you could use some sort of
 certificate for this, although I don't know much about mail servers.

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk





-- 
Marc Trudel-Bélisle
www.wizcorp.jp


[PHP] Including file from a registered shutown function on a syntax parse error

2010-01-31 Thread Marc Trudel
Greetings,

If I register a shutdown function in PHP (to catch syntax parse errors and
send them in logs), it looks like I can open files, but I cannot do includes
- that is, if the reason of exit is a syntax parse error.

Is this a desired effect?  It seems a tad odd that I could do
eval(preg_replace(#^\?[php]?#, , file_get_contents($file))); but not
include($file);

-- 
Marc Trudel-Bélisle
www.wizcorp.jp