php-general Digest 30 Jan 2011 04:44:09 -0000 Issue 7158

Topics (messages 311080 through 311083):

Re: 95th percentile of an array.
        311080 by: Adam Richardson
        311081 by: Paul Halliday

Re: "public static" or "static public"?
        311082 by: Colin Guthrie

PEAR & PHP
        311083 by: Ethan Rosenberg

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
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

That said, there are many ways to calculate percentile (I tend to think in
Z-scores, myself), and nearest rank has its issues, depending on your needs:
http://en.wikipedia.org/wiki/Percentile

<http://en.wikipedia.org/wiki/Percentile>Hopefully the example and the link
give you enough to get what you need working.

Adam

On Sat, Jan 29, 2011 at 11:15 AM, Paul Halliday <[email protected]>wrote:

> What is the quickest way to do this? Will stats_stat_percentile work?
> If so, does anyone have examples of its operation?
>
> Keep in mind that my math is terrible. Use small words :)
>
> Thanks.
>
> --
> Paul Halliday
> http://www.pintumbler.org
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
On Sat, Jan 29, 2011 at 2:28 PM, Adam Richardson <[email protected]> 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.

--- End Message ---
--- Begin Message ---
'Twas brillig, and David Harkness at 28/01/11 18:41 did gyre and gimble:
> On Fri, Jan 28, 2011 at 10:35 AM, Mujtaba Arshad <[email protected]>wrote:
> 
>> Having learned java before even knowing what php was (yeah I'm a noob in
>> both) I prefer scope static function.
> 
> 
> I learned Java first, too, and also prefer the scope first. I place a scope
> on every method, so I'd rather the first word always be the scope rather
> than sometimes scope, sometimes static. I also think of it as a "static
> function" that happens to be "public." Finally, I prefer to group static
> members at the top of the class to differentiate them as a separate API for
> the class itself.

Well that wasn't even vaguely controversial! Was hoping that some people
would have some more "creative" reasoning for both sides!

Ahh well, this all ties in with my view, so I'm not really complaining :D

Cheers for the insights.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


--- End Message ---
--- Begin Message ---
Dear list -

I enter the command pear list, and get errors.  See below --

ethan@rosenberg:/usr/lib/php5$ ls -l
total 12
drwxr-xr-x 2 root root 4096 Jan  6 00:53 20090626+lfs
drwxr-xr-x 2 root root 4096 Jul 18  2010 libexec
-rwxr-xr-x 1 root root  596 Jan  5 08:09 maxlifetime

ethan@rosenberg:/usr/lib/php5$ pear list
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/msql.so' - /usr/lib/php5/20090626+lfs/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
<font color=#ff0000>
Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/msql.so' - /usr/lib/php5/20090626+lfs/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
</font>Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.7   stable
Console_Getopt   1.2.3   stable
PEAR             1.9.1   stable
Structures_Graph 1.0.3   stable
Validate_US      0.5.4   beta
XML_Util         1.2.1   stable

ethan@rosenberg:/usr/lib/php5$ cd 20090626+lfs

ethan@rosenberg:/usr/lib/php5/20090626+lfs$ ls -l
total 560
-rw-r--r-- 1 root root  95596 Jan  5 08:09 gd.so
-rw-r--r-- 1 root root  38272 Jan  5 08:09 mcrypt.so
-rw-r--r-- 1 root root 109220 Jan  5 08:09 mysqli.so
-rw-r--r-- 1 root root  42352 Jan  5 08:09 mysql.so
-rw-r--r-- 1 root root  26116 Jan  5 08:09 pdo_mysql.so
-rw-r--r-- 1 root root  87588 Jan  5 08:09 pdo.so
-rw-r--r-- 1 root root 141336 Aug 19 04:04 suhosin.so

ethan@rosenberg:/usr/lib/php5/20090626+lfs$

Help and advice, please.

Thanks.

Ethan

MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)]


--- End Message ---

Reply via email to