php-general Digest 30 May 2011 04:47:05 -0000 Issue 7334
Topics (messages 313224 through 313234):
Re: iPhone sadness
313224 by: Simon J Welsh
313225 by: Geoff Shang
313226 by: Lester Caine
313227 by: Ashley Sheridan
313231 by: Igor Konforti
313234 by: Paul M Foster
Re: phpsadness
313228 by: Robert Cummings
Unique multi dimensional arrays
313229 by: admin.buskirkgraphics.com
displaying a pdf
313230 by: Jim Giner
313232 by: Jim Giner
313233 by: Simon J Welsh
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 ---
On 29/05/2011, at 9:48 PM, Richard Quadling wrote:
> On 29 May 2011 01:36, TR Shaw <[email protected]> wrote:
>> (sorry for the top posting)
>>
>> Sent from my iPad
>>
>
> Are you telling me that you can't scroll down the page on an iPad?
>
> I refer back to my comment that the "Sent from my iPad/iPhone" is
> inherently an apology.
>
>
>
> --
> Richard Quadling
> Twitter : EE : Zend : PHPDoc
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
The signature is inserted at the top. Refer back to the replies to your comment.
---
Simon Welsh
Admin of http://simon.geek.nz/
--- End Message ---
--- Begin Message ---
On Sun, 29 May 2011, Richard Quadling wrote:
On 29 May 2011 01:36, TR Shaw <[email protected]> wrote:
(sorry for the top posting)
Sent from my iPad
Are you telling me that you can't scroll down the page on an iPad?
I refer back to my comment that the "Sent from my iPad/iPhone" is
inherently an apology.
Ironicly, it's on by default. It can be turned off, however.
Geoff.
--- End Message ---
--- Begin Message ---
Geoff Shang wrote:
On 29 May 2011 01:36, TR Shaw <[email protected]> wrote:
(sorry for the top posting)
Sent from my iPad
Are you telling me that you can't scroll down the page on an iPad?
I refer back to my comment that the "Sent from my iPad/iPhone" is
inherently an apology.
Ironicly, it's on by default. It can be turned off, however.
I think that sums up many of the 'practices' that we have to put up with.
Someone decided they did not like the current method of working, so changed a
default, and all subsequent users simply don't know any better :(
A crib sheet on how to configure email clients to match a particular way of
working would be nice - except it has to be done on a list by list basis in the
client - such as needing 'reply all' rather than 'reply', and indenting quotes
properly.
There IS no right way - but it IS polite to follow the rules even if it is a
little more difficult doing it from your chosen software. Rather than
apologising or simply ignoring the guide lines.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--- End Message ---
--- Begin Message ---
"Lester Caine" <[email protected]> wrote:
>Geoff Shang wrote:
>>
>>> On 29 May 2011 01:36, TR Shaw <[email protected]> wrote:
>>>> (sorry for the top posting)
>>>>
>>>> Sent from my iPad
>>>
>>> Are you telling me that you can't scroll down the page on an iPad?
>>>
>>> I refer back to my comment that the "Sent from my iPad/iPhone" is
>>> inherently an apology.
>>
>> Ironicly, it's on by default. It can be turned off, however.
>
>I think that sums up many of the 'practices' that we have to put up
>with.
>Someone decided they did not like the current method of working, so
>changed a
>default, and all subsequent users simply don't know any better :(
>
>A crib sheet on how to configure email clients to match a particular
>way of
>working would be nice - except it has to be done on a list by list
>basis in the
>client - such as needing 'reply all' rather than 'reply', and indenting
>quotes
>properly.
>
>There IS no right way - but it IS polite to follow the rules even if it
>is a
>little more difficult doing it from your chosen software. Rather than
>apologising or simply ignoring the guide lines.
>
>--
>Lester Caine - G8HFL
>-----------------------------
>Contact - http://lsces.co.uk/wiki/?page=contact
>L.S.Caine Electronic Services - http://lsces.co.uk
>EnquirySolve - http://enquirysolve.com/
>Model Engineers Digital Workshop - http://medw.co.uk//
>Firebird - http://www.firebirdsql.org/index.php
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
I must admit that its a default on the standard email app on android as well. I
switched to using K9 mail now, which is a lot more versatile. Don't know if you
can get it on an iPhone, but there are definitely alternatives from the stock
client.
Thanks
Ash
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--- End Message ---
--- Begin Message ---
What? Replay to all? Its configurable!
However by default there is no spam signatures such as "send from my
iphone/k9"
On May 29, 2011 3:29 PM, "Ashley Sheridan" <[email protected]> wrote:
> "Lester Caine" <[email protected]> wrote:
>
>>Geoff Shang wrote:
>>>
>>>> On 29 May 2011 01:36, TR Shaw <[email protected]> wrote:
>>>>> (sorry for the top posting)
>>>>>
>>>>> Sent from my iPad
>>>>
>>>> Are you telling me that you can't scroll down the page on an iPad?
>>>>
>>>> I refer back to my comment that the "Sent from my iPad/iPhone" is
>>>> inherently an apology.
>>>
>>> Ironicly, it's on by default. It can be turned off, however.
>>
>>I think that sums up many of the 'practices' that we have to put up
>>with.
>>Someone decided they did not like the current method of working, so
>>changed a
>>default, and all subsequent users simply don't know any better :(
>>
>>A crib sheet on how to configure email clients to match a particular
>>way of
>>working would be nice - except it has to be done on a list by list
>>basis in the
>>client - such as needing 'reply all' rather than 'reply', and indenting
>>quotes
>>properly.
>>
>>There IS no right way - but it IS polite to follow the rules even if it
>>is a
>>little more difficult doing it from your chosen software. Rather than
>>apologising or simply ignoring the guide lines.
>>
>>--
>>Lester Caine - G8HFL
>>-----------------------------
>>Contact - http://lsces.co.uk/wiki/?page=contact
>>L.S.Caine Electronic Services - http://lsces.co.uk
>>EnquirySolve - http://enquirysolve.com/
>>Model Engineers Digital Workshop - http://medw.co.uk//
>>Firebird - http://www.firebirdsql.org/index.php
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
> I must admit that its a default on the standard email app on android as
well. I switched to using K9 mail now, which is a lot more versatile. Don't
know if you can get it on an iPhone, but there are definitely alternatives
from the stock client.
>
>
> Thanks
> Ash
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
On Sun, May 29, 2011 at 12:50:36PM +0100, Lester Caine wrote:
[snip]
>
> There IS no right way - but it IS polite to follow the rules even if
> it is a little more difficult doing it from your chosen software.
> Rather than apologising or simply ignoring the guide lines.
I would imagine that interleaved replies or bottom posting will never be
considered offensive on any list. Whereas we all know that top posting
can often be considered offensive, depending on the list.
By the way, bottom posting only really becomes offensive when you fail
to trim as needed.
Paul
--
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com
--- End Message ---
--- Begin Message ---
On 11-05-28 08:36 PM, TR Shaw wrote:
Well the argument has both sides. Division by zero on many platforms resulted
in zero. Then came IBM360 and it generated an exception causing big time issues
in legacy code so a OS patch was written to intercept the interrupt, jam the
result to zero and return.
Although mathematically undefined is correct, in most programtic cases zero is
an acceptable and in fact a preferred result.
(sorry for the top posting)
Personally, I prefer the exception. Logically, I can take 0 from
something an infinite number of times... zero seems a far cry from this.
To properly determine the intent of a division by zero, I think the
programmer SHOULD have to handle it.
Personally, I don't see 0 as acceptable. It suggests improper boundary
checking.
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
I have worked for some time on developing a method for this issue. The
problem has always been the flexibility of the method to work in any
situation.
I had initially thought this might be my solution.
Function multi_dim_unique($array='')
{
For ($a=0;$b=count($array);$a<$b;$a++) {
For ($c=0,$d=count($array[$a]);$c<$d;$c++) {
$tmp = $array[$a][$c];
If (!isset
($record_array[$tmp])) {
$record_array[$tmp] = $c;
}
}
}
Foreach ($record_array as $key=>$value) {
$array[$value][] = $key;
}
Return $array;
}
While this concept work perfect for multi dimensional arrays like.
$array = (0=>array(0=>12345,1=>67890),1=>array(0=>12345,1=>67890,2=>11111));
I find myself constantly needing to dig deeper and unique at other positions
of the array but still have the flexibility.
$array = array([0] = > array(['Company'] => array( [0] = > ABC,[1] =>
CBS,[2] => NBC), [Owners] => array ( [0] => John,[1] => Mark,[2] => John));
In a desire to find the unique Owner names from the array above. The initial
method is not accommodating for this array and will return the entire array
as presented.
My new thoughts are to pass a parameter to the method for the position I
want unique.
$position = 'Owners';
multi_dim_unique($array,$postion);
Here lies the problem finding the position match no matter how many
dimensions there are.
My question is has anyone tackled this issue and may have some suggestions
as to how I may reconstruct the method to be a bit more accommodating to
situations like this.
Richard L. Buskirk
--- End Message ---
--- Begin Message ---
Perhaps someone can tell me what I'm doing wrong. I did some ( a lot)
looking around for hints on this and here is what I have compiled. It
doesn't work - just goes to a white, blank page and sits. I don't know if I
need all the html parts or even if I have placed my php in the right areas.
BTW - all I want to do is use a menu option to take me to a page that shows
the pdf. My menu (a js thing) won't let me use an <a> element, so I'm
trying to just build a php page that I can go to and display the doc
automacitcally without the user having to click on something..
[code begins]
<?php
session_start();
$root = $_SERVER['DOCUMENT_ROOT'];
$pdfname='/pdfs/myfile.pdf';
$length = filesize($pdfname);
//
header("Content-type: application/pdf");
header("Content-Disposition: inline; filename=".$pdfname);
header("Content-Length: ".$length);
//
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<?
readfile=$pdfname;
?>
</body>
</html>
[code ends]
Thanks in advance!
--- End Message ---
--- Begin Message ---
Update.
I re-arranged my code and now I get a popup saying "File does not begin with
'%PDF-'.
Here's the code as it is now.
<?php
session_start();
header("Cache-Control: no-cache");
header("Content-type: application/pdf");
$root = $_SERVER['DOCUMENT_ROOT'];
$pdfname=$root.'/pdfs/myfile.pdf';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>|</title>
</head>
<body bgcolor="#c0c0c0">
</body>
</html>
--- End Message ---
--- Begin Message ---
On 30/05/2011, at 9:02 AM, Jim Giner wrote:
> Perhaps someone can tell me what I'm doing wrong. I did some ( a lot)
> looking around for hints on this and here is what I have compiled. It
> doesn't work - just goes to a white, blank page and sits. I don't know if I
> need all the html parts or even if I have placed my php in the right areas.
>
> BTW - all I want to do is use a menu option to take me to a page that shows
> the pdf. My menu (a js thing) won't let me use an <a> element, so I'm
> trying to just build a php page that I can go to and display the doc
> automacitcally without the user having to click on something..
>
> [code begins]
> <?php
> session_start();
> $root = $_SERVER['DOCUMENT_ROOT'];
> $pdfname='/pdfs/myfile.pdf';
> $length = filesize($pdfname);
> //
> header("Content-type: application/pdf");
> header("Content-Disposition: inline; filename=".$pdfname);
> header("Content-Length: ".$length);
> //
> ?>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> </head>
> <body>
> <?
> readfile=$pdfname;
> ?>
> </body>
> </html>
> [code ends]
>
> Thanks in advance!
You don't want the HTML, as it's not part of the PDF. The first example on
http://php.net/header even shows what you're trying to achieve.
<?php
session_start();
$root = $_SERVER['DOCUMENT_ROOT'];
$pdfname='/pdfs/myfile.pdf';
$length = filesize($pdfname);
//
header("Content-type: application/pdf");
header('Content-Disposition: inline; filename='.basename($pdfname).'"');
header("Content-Length: ".$length);
//
readfile($pdfname);
---
Simon Welsh
Admin of http://simon.geek.nz/
Who said Microsoft never created a bug-free program? The blue screen never,
ever crashes!
http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e
--- End Message ---